Is there a way to make similar query on system collection Player in order to avoid multiple mongodb access with findOne( { _id: { $oid: id} }) for id=id1, ... , idn ?
Best Regards,
Sasha
Best Answer
C
Customer Support
said
over 6 years ago
Hi Sasha,
This is possible, but the array elements you're checking against need to be objectIds. This syntax should work:
SashaMirkovic
Hello,
It is possible In MongoDb to make query:
collection.find({ "_id.$oid": { $in: [ id1, ... , idn ] } });
Is there a way to make similar query on system collection Player in order to avoid multiple mongodb access with findOne( { _id: { $oid: id} }) for id=id1, ... , idn ?
Best Regards,
Sasha
Hi Sasha,
This is possible, but the array elements you're checking against need to be objectIds. This syntax should work:
collection.find({"_id":{"$in":[{"$oid":id1},{"$oid":id2}......,{"$oid":idn]}});
Try this out and let us know how it works for you.
Regards,
Vinnie
Customer Support
Hi Sasha,
This is possible, but the array elements you're checking against need to be objectIds. This syntax should work:
collection.find({"_id":{"$in":[{"$oid":id1},{"$oid":id2}......,{"$oid":idn]}});
Try this out and let us know how it works for you.
Regards,
Vinnie
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics