Page 1 of 1

Collection.query() with pointer type as criteria fails

Posted: Sat Aug 30, 2014 12:15 pm
by girish

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?


Collection.query() with pointer type as criteria fails

Posted: Sat Aug 30, 2014 1:14 pm
by Alena Prykhodko

Hi Girish,

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


Collection.query() with pointer type as criteria fails

Posted: Sun Aug 31, 2014 9:33 pm
by Yurii Orishchuk

Hi Girish,

Please use this code instead of yours:

pre

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

/pre

Regards.


Collection.query() with pointer type as criteria fails

Posted: Mon Aug 24, 2015 1:31 pm
by Freddy7709766

Hello,

I have exactly the same issue than Girish.

The is any workaroud, solution?

Regards,


Collection.query() with pointer type as criteria fails

Posted: Mon Aug 24, 2015 7:07 pm
by Evgene Karachevtsev

Hello Freddy,

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