Start a new topic

[GAE Integration] Performing a geoNear query on SubDocument

Hi,

I have a document of the following format:

{

"_id": "1",

"name": "Costa",

"description":"Costa is the biggest chain of coffee worldwide",

"stores":[{

"id":"1",

"name":"Costa store",

"description":"the very first store of costa",

"location":[25.139651,55.220234]

]}

}



and I want to use the method geoNear(x, y, options) from kinvey-sdk in order to match a location query. currently what I understood that it's available only on the document level, so my question is what is the way to perform this on the subdocument level - given that there is an available option of passing a query as per this link http://mongodb.github.io/node-mongodb-native/api-generated/collection.html#geoNear.



Thanks,

1 Comment

We don't expose 2d indexing for subdocuments. One workaround is to change the documents so that Stores are in a separate collection.
Login or Signup to post a comment