db.<collection>.find( { <location field> : { $geoWithin : { $centerSphere : [ [ <x>, <y> ] , <radius> ] } } } )
The collection will have a location field (long/lat) and a radius field in addition to some other fields
I want to do something like
db.<collection>.find( { [<x>,<y>] : { $geoWithin : { $centerSphere : [ this.location , this.radius ] } } } )
to find those locations that my x,y is inside the circle
which is really the inverse of how this type of query is specified.
I wound up storing keys and radius separately, using the geoNear command using the known long/lat and some max radius and using the distance that comes back and comparing with the radius data as a separate step. Works pretty well, not the cleanest answer.
--
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.
For other MongoDB technical support options, see: http://www.mongodb.org/about/support/.
---
You received this message because you are subscribed to a topic in the Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-user/0AnIgROAcEU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongodb-user...@googlegroups.com.
To post to this group, send email to mongod...@googlegroups.com.
Visit this group at http://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/cd12660b-f720-40a6-9eb0-1b8bfe63ed48%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.