Start a new topic

Compound Queries in BL or REST API

There is an example of compound queries and Joining Operators in the HTML5 Data Store Guide : http://devcenter.kinvey.com/html5/guides/datastore#CompoundQueries



However, there is no such example in the REST API Data Store Guide nor the BL Custom Endpoint.



Can you post some official examples of using "OR", "AND", and "NOR" in the other guides please?

1 Comment

So I came up with my own solution. It seems to work okay.



var userCollection = modules.collectionAccess.collection('user');



var query = {

$or: [

{ "email" : "some email address here" },

{ "mobile" : "some mobile number here" }

]

};



userCollection.find( query, function( queryError, queryResults ) {



if( error ) {

// Deal with error here.



return;

} else {

// Deal with your logic here.

}



});



Blogged about here : http://calendee.com/performing-compound-queries-with-joining-operators-in-kinvey-business-logic/
Login or Signup to post a comment