Skip to content

Support to Query and Projection Operators

Pradeeban Kathiravelu edited this page Aug 2, 2018 · 5 revisions

Bindaas Mongo data source provider naturally supports all the query and projection operators.

Comparison Query Operators

Bindaas also supports comparison query operators such as $gt.

{ "_operation" : "find" , "_operation_args" : { "query" : {'qty': {$gt: 50}} , "fields" :{ 'type' : 0 }, "skip" : 0, "limit" : 1000, "sort" : {'qty': -1, '_id':1} } }

Element Query Operators

Bindaas supports the element query operators, $exists and $type.

{ "_operation" : "find" , "_operation_args" : { "query" : {'qty': { $exists: true }} , "fields" :{}, "skip" : 0, "limit" : 1000 } }

The above query returns the documents where the property 'qty' exists.

{ "_operation" : "find" , "_operation_args" : { "query" : {'qty': { $type: double }} , "fields" :{}, "skip" : 0, "limit" : 1000 } }

The above query returns the documents where the property 'qty' consists of a value type of double.

Regular Expressions

Bindaas supports regular expressions ($regex).

{ "_operation" : "find" , "_operation_args" : { "query" : { 'item' : {$regex: "$item$", $options: "i"}, 'type' : {$regex: "$type$", $options: ""}} , "fields" :{ '_id' : 0 }, "skip" : 1, "limit" : 1000, "sort" : {'qty': -1, '_id':1} } }

Projection Operators

Bindaas supports projection operators such as $meta.

{ "_operation" : "find" , "_operation_args" : { "query" : {}, "fields" :{'item': {$meta:'textScore'}}, "skip" : 0, "limit" : 1000, "sort" : {'qty': -1, '_id':1} } }

Clone this wiki locally