-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"name":"MongoError","ok":0,"errmsg":"can't find ns" #2313
Comments
Hi @xiaojunl , can you provide me some standalone code that reproduces this? |
ShopModel.geoNear([121.600590,31.198366], {geoNear: 'name', spherical: true, distanceMultiplier: 6371, num: 100, maxDistance: 20 / 6371, query: {'traffic.status': 'on', name: {$regex: word}}}, function (err, shops, stats) { ... } |
Thanks for that. This will go faster if you provide one standalone file that reproduces this that includes schema definitions though :) |
Of course :) |
@vkarpov15 |
@327 this is caused by you putting that Replace:
With:
And you should stop getting that error. |
Further clarification: specifying 'name' is not necessary there - since there can only be one 2d index on an object, there's no need to tell |
@vkarpov15 thank you very much !
hope it's useful for other people |
right,resolved. |
{ $geoNear: { near: { type: "Point", coordinates: [parseFloat(user_result.lng), parseFloat(user_result.lat)] }, distanceMultiplier: 0.001, maxDistance: 100000, spherical: true, distanceField: "dist.calculated", query: { lat: { $ne: '' }, lng: { $ne: '' } } } } This will solve your problem with ns. |
Upgrade from version v3.8.8 to v3.8.16,invoke getNear.
The text was updated successfully, but these errors were encountered: