-
Notifications
You must be signed in to change notification settings - Fork 31
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
Custom near query not working #65
Comments
Hmmm... that's odd. Take a look at the unit test for The error also says that mongoDB is unable to find a geospatial index for the $geoNear query. Have you added the index to the |
Definitely have an index for the I will check the unit tests and report again. |
Thanks. Also, just try to run this: const mqs = new MongoQS({
custom: {
near: 'loc',
},
});
console.log(mqs.parse({ loc: '1,2' })); |
Ok it looks like this is my mistake, something else weird is going on with
a destructure operation. That does actually work, (replacing the query with {near: '1,2'} ).
Thanks for your time.
|
No problem, glad we could sort this out. Please report back if you find any errors with the code so we can fix them. |
I'm having a problem with the custom near query again, using v4.4.1
If I specify a name for the query like so:
It throws an error from Mongo:
It seems to be returning the entire function as a query. Is that expected behaviour?
I manually overrode the query with :
and it now works fine for me.
The text was updated successfully, but these errors were encountered: