Hello ![]()
Feature(s) impacted
Dashboard, charts, filter
Observed behavior
In my database, I have a table called beneficiaries, which is related to the nv_contract table
when I set the filter to the right value, it fine
agent.addChart('beneficiariesNVbyDays', async (context, resultBuilder) => {
try {
const aggregation = { operation: 'Count', field: 'nv_contract' };
const filter = {
conditionTree: { field: 'nv_contract:createdAt', operator: 'Equal', value: ' 2024-06-12T13:13:56.760Z' },
};
const beneficiariesList = await context.dataSource
.getCollection('beneficiaries')
.aggregate(filter, aggregation);
console.log(beneficiariesList)
return resultBuilder.objective(235, 300);
} catch (error) {
console.error(`Error while count nv beneficiaries by days, error : ${error}`);
throw error;
}
I have this log:
[ { value: 1, group: {} } ]
Expected behavior
But I would like to filter only with days, months and years, without time etc…
Example:
conditionTree: { field: 'nv_contract:createdAt', operator: 'Equal', value: '2024-06-12' },
Is it possible to have this kind of behavior?
Context
- Project name: Nostrum Care v3
- Team name: Op
- Environment name: Local
- Agent (forest package) name & version:
“@forestadmin/agent”: “^1.0.0”,
“@forestadmin/datasource-sequelize”: “^1.5.21”,
“@forestadmin/datasource-sql”: “^1.0.0”,
“dotenv”: “^16.0.1”,
“pg”: “^8.8.0”,
“sequelize”: “^6.33.0”,
“stripe”: “^14.17.0” - Database type: Postgresql
Thanks in advance for your feedback!