Details
-
Task
-
Resolution: Won't Do
-
Major - P3
-
None
-
mongodb 3.2.7
*Location*: https://docs.mongodb.com/v3.2/reference/command/geoNear/#dbcmd.geoNear
*User-Agent*: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36
*Referrer*: https://docs.mongodb.com/v3.2/reference/command/
*Screen Resolution*: 1366 x 768
mongodb 3.2.7 *Location*: https://docs.mongodb.com/v3.2/reference/command/geoNear/#dbcmd.geoNear *User-Agent*: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36 *Referrer*: https://docs.mongodb.com/v3.2/reference/command/ *Screen Resolution*: 1366 x 768
Description
In my document there is a array which contain the point, below is an example:
{
"detail": [
{
"name":"jack",
"loc":
},
{
"name":"tom",
"loc":
}
]
}
When I use command to search:
db.runCommand( { geoNear:"Table1" ,
near:
,
spherical: true,
includeLocs:true,
uniqueDocs:true,
maxDistance: 300
} )
I want "jack" to be return but "tom" because the distance between tom and [113.167294, 23.447903] is larger then 300 meters. But the command return all of them.
How do I limit the result which is just match the condition in Array. Thanks