This documentation only refers to where in Forest Admin segments. Maybe it’s a misleading example.
So basically, you can continue using the Sequelize queries.
In the other hand, we propose both usages (Native Querie Sequelize / Forest Admin Query Interface) in the agent code. You can find more relevant information about this in the following documentation.
PS: The main advantage of our Query Interface is that you can access customisations easily (computed field, relationships, …)
It only refers to Smart segments definition. And it’s up to you and your preferences, you can use Native query (sequelize) or the Query Interface.
See those examples:
Native query (sequelize) example
collection.addSegment('mySegment', async context => {
const rows = await context.collection.nativeDriver.rawQuery(`
SELECT product_id, COUNT(*)
FROM orders
GROUP BY product_id
ORDER BY count DESC
LIMIT 10;
`);
return { field: 'id', operator: 'In', value: rows.map(r => r['product_id']) };
});