girish
Posts: 0
Joined: Sat Aug 30, 2014 12:15 pm

Collection.query() with pointer type as criteria fails

i have a problem with invoking a query using pointer as the criteria.

I have a collection "Merchandise", which has a column "Category", which is of pointer type referring to another collection "Category". The collection "Category" has two columns, "_id" and "Category Name".

When i give a normal type into a query as criteria it works -

params.criteria={"Value":200};
var categoryList = Collection.query(DB_Id, "Merchandise",params);
console.log(categoryList.length); //== gives 2 as answer

But when i give a pointer type criteria, it fails

params.criteria={"Category":{"_id":"5400c608e4b051d053e3d986","CategoryName":"Movie Tickets"}};
params.include="Category";
var categoryList = Collection.query(DB_Id, "Merchandise",params);
console.log(categoryList.length); //==gives 0 as answer

Any suggestion?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Collection.query() with pointer type as criteria fails

Hi Girish,

Working on it. We will update as soon as we have more information from development team. This may take some time.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Collection.query() with pointer type as criteria fails

Hi Girish,

Please use this code instead of yours:

pre

params.criteria = {
Category: {"$inQuery": {_id: "5400c608e4b051d053e3d986" } }
};

/pre

Regards.

Freddy7709766
Posts: 0
Joined: Thu Aug 20, 2015 9:08 am

Collection.query() with pointer type as criteria fails

Hello,

I have exactly the same issue than Girish.

The is any workaroud, solution?

Regards,

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Collection.query() with pointer type as criteria fails

Hello Freddy,

Could you please provide us with more details of your issue? Also please clarify have you tried Yurii's approach?

Return to “Issues”