Query interface
When to use it?
-
Forest Admin Query Interface
Native Driver
Example
collection.addSegment('mySegment', async context => {
const rows = await context.dataSource
.getCollection('orders')
.aggregate({}, { operation: 'Count', groups: [{ field: 'product_id' }] }, 10);
return { field: 'id', operator: 'In', value: rows.map(r => r['product_id']) };
});Interface
Last updated