araskin3i
Posts: 0
Joined: Fri Dec 20, 2013 2:44 pm

$eq invalid operator

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?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

$eq invalid operator

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

araskin3i
Posts: 0
Joined: Fri Dec 20, 2013 2:44 pm

$eq invalid operator

Thank you that worked.

Return to “Issues”