siddhi-io / siddhi-store-mongodb

Extension that can be used to perform DB operations with Mongo DB
https://siddhi-io.github.io/siddhi-store-mongodb/
Apache License 2.0
4 stars 21 forks source link

How to parse a MongoDB query using Siddhi #46

Open BuddhiWathsala opened 5 years ago

BuddhiWathsala commented 5 years ago

Description: As far as I understand using the test cases provided here we can do all CRUD operations to the MongoDB using this Siddhi MongoDB extension. My question is how do I parse a complex query(like below) into a MongoDB table and get the output to Siddhi level for further process.

db.employees.aggregate( [
   {
      $graphLookup: {
         from: "employees",
         startWith: "$reportsTo",
         connectFromField: "reportsTo",
         connectToField: "name",
         as: "reportingHierarchy"
      }
   }
] )

Refer https://docs.mongodb.com/manual/reference/operator/aggregation/graphLookup/#examples

niveathika commented 5 years ago

Not all operations are supported, Out of siddhi operations only AND, OR, Compare operators and null check is supported. https://github.com/siddhi-io/siddhi-store-mongodb/blob/master/component/src/main/java/io/siddhi/extension/store/mongodb/MongoExpressionVisitor.java#L318