This is part of the MongoDB datasource implementation (#192), related Issue: #176
Currently, readMongoDatasourceRows and validateMongoFDAContract only supports the find query variant (collection, filter, projection). When aggregation is provided, it throws a InvalidMongoFDAContract error.
To do:
- Implement support for MongoDB aggregation pipelines in
readMongoDatasourceRows and validateMongoFDAContract
- The
aggregation field should accept a MongoDB aggregation pipeline array, e.g.:
{
"collection": "sensors",
"aggregation": [
{ "$group": { "_id": "$category", "n": { "$sum": 1 } } }
]
}
- Ensure
filter and aggregation are mutually exclusive (validation should reject both being present)
- Consider whether to restrict certain stages like
$out, $merge, etc. (document as needed)
This is part of the MongoDB datasource implementation (#192), related Issue: #176
Currently,
readMongoDatasourceRowsandvalidateMongoFDAContractonly supports thefindquery variant (collection,filter,projection). Whenaggregationis provided, it throws aInvalidMongoFDAContracterror.fiware-data-access/src/lib/utils/mongo.js
Line 176 in 39ad3cf
fiware-data-access/src/lib/fda.js
Line 180 in 39ad3cf
To do:
readMongoDatasourceRowsandvalidateMongoFDAContractaggregationfield should accept a MongoDB aggregation pipeline array, e.g.:{ "collection": "sensors", "aggregation": [ { "$group": { "_id": "$category", "n": { "$sum": 1 } } } ] }filterandaggregationare mutually exclusive (validation should reject both being present)$out,$merge, etc. (document as needed)