-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Issue creating GeoSpatial indexes with altered range #459
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
Conversation
See also this Mongoose issue that is possibly related: Automattic/mongoose#664 |
I have fixed the issue which was in db_command.js. It wasn't using min and max options when it built up the command. This code probably wants tidying up, but all tests pass and it solves the issue. |
Issue creating GeoSpatial indexes with altered range
This seems to still be broken for me. I was having the same issue and while searching for a potential solution, I found this page. I just installed [email protected] in order to fix the problem (was running a much older version), but when I reran my code I got the same "point not in interval of [-180, 180)]" error. Here's my code:
I get the exact same error as antz29 first did. @antz29 have the errors from running the above code gone away for you? |
This test passes for me and does exactly what you are trying to do. I'm running MongoDB 2.0.3. I might be you are running an earlier version without min, max support ?
|
hmmm that's really weird. it seems that the area is in my usage of the variable "pos" instead of "loc". using my same code, if i switch it to say "loc", it works totally fine. i didn't realize that word needed to be exact in the past. i've always used other variables, just the altered ranges have been small (-1 to 1 or something like that) where they haven't gotten out of the standard range. sami |
wait nvm, that's not true. I just got code to work with another variable elsewhere using a simple insert (a la your code above). I guess the only other difference between my code and others is that I was using collection.findAndModify() to set new 2D location variables. Maybe the code for findAndModify isn't working properly? (though it does seem to work fine now that I've switched my "pos:'2d'" to "loc:'2d'") |
it could be you had an existing index with no min/max |
I tried using dropIndex() numerous times and the index just didn't exist. I wonder in retrospect if the issue was that the index simply wasn't created a bunch of times for who-knows-what-reason? whatever the case, it works now. thanks for responding! |
you need to call it with safe:true to ensure the error message is returned |
yeah i noticed that in your code and updated it in mine as well. thanks! |
Hi there
I seem to be having an issue creating a geo spatial index with an altered range.
Here is my test code:
This will always output:
Suggesting that the index wasn't created with the correct range. Calling ensureIndex from the Mongo REPL creates the correct index.
I'm using [email protected] and [email protected] with [email protected]
If I'm doing something obviously wrong could you point it out?
Cheers
John