Skip to content

Support MongoDB aggregation pipelines in FDA queries #197

Description

@GregorioBlazquez

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.

throw new FDAError(

throw new FDAError(

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions