-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Environment:Mongodb 3.0.4
*Location*: https://www.mongodb.org/about/support/
*User-Agent*: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0
*Referrer*: http://osdir.com/ml/mongodb-user/2015-02/msg00656.html
*Screen Resolution*: 1366 x 768
*repo*: mongodb-www-about
*source*: support
A user has two addresses (one "pickup address" and one "delivery address").
The user wants to find other users which have similar pickup AND delivery addresses (this is why I need two $geoNear).
Example data (simplified):
User, pickup address, delivery address:
User 1, Germany, USA
User 2, France, Spain
User 3, Germany, USA
User 4, Germany, France
User 5, Canada, USA
User 6, Germany, USA
If user 1 wants to find other users, user 3 and user 6 have to be shown (because only there both addresses are "near").
In my real project the data is a bit more complex and of course I have real addresses (with latitude and longitude).
If two $geoNear are not possible, I could go first for the pickup address, then for the delivery address. However I fear a bad performance here because I have millions of addresses.
Need more details? Please let me know.