Start a new topic

How to use mongodb positional $ operator?


Lets say we have a collection Unit with embedded zones in it:


{ _id: "123,

   name: "unit1",

  zones: [

     {id: 1, name : "z1", ...},

     {id : 2, name : "z2"}





How do I use Kinvey datastore query to fetch only zone with id = 2? How do I used mongoDB supported positional operator $  e.g.     something like:

query.equalTo('zone.$.id', 2) ...? Is it supported and how?

1 Comment

Good afternoon Raghavendra,

You can use modules.CollectionAccess in businesslogic to run what are essentially "raw" mongo queries.  You can read more about that over here:


Login or Signup to post a comment