As orders are not referenced as a field in the collection users, you won’t be able to filter on this condition with the query interface.
Here is a potential workaround if the number of users with orders is not too big:
collection.addSegment('mySegment', async context => {
const itemsCount = await context.dataSource.getCollection('order').aggregate({}, {
operation: "Sum",
value: 1,
groups: [{ field: "userIdentifier" }], /* smart field based on user:id
as you won't be able to use "user:id" here */
});
return { field: 'id', operator: 'NotIn', value: itemsCount.map((item) => item.group.userIdentifier) };
});
Hi @kll ,
Thank you for notifying us,
There is no new feature on this subject, unfortunately. It is not in the roadmap currently, but some other user have requested a similar solution. I can’t promise you a new feature soon, but the request was heard.
Hi @Enki! Thanks for the reply, hopefully this makes it through one day
I believe you’re focusing more on the ops side of things, so it would also be cool to have some sort of personalization available on the front-end to handle one-to-many scenarios easily. Things like counts, averages, sums…