Page 1 of 1

$eq invalid operator

Posted: Mon Feb 10, 2014 6:31 pm
by araskin3i

I am creating a server side API call with the following code:

code
var params = {}; //Define parameters object
params.criteria = { //Query criteria:
'objectId': {
"$eq": myObjId
}
};
//Define other parameters
params.limit = 1; //only get the latest record for this truck
params.sort = "_createdAt&quot //Ascending sort by creation date/time

console.log('about to call Query');
var queryResult = Collection.query(DB_id, "someTable", params, sessionToken);

/code

When I run this I get an error saying that $eq is not a valid operator. SHoudl I be using $in instead? Or perhaps there is another method that I am looking at to do this look up?


$eq invalid operator

Posted: Mon Feb 10, 2014 7:41 pm
by Kateryna Grynko

Hi Alon,

Please replace:pre'objectId': {
"$eq": myObjId
}/pre
With:pre'objectId': myObjId/pre
Or, if you use Appery.io Database replace codeobjectId/code with codeobject_id/code


$eq invalid operator

Posted: Mon Feb 10, 2014 7:50 pm
by araskin3i

Thank you that worked.