christkv/node-mongodb-native — Issue #459: Issue creating GeoSpatial indexes with altered range
Author: antz29
Created: 2011-12-23 12:14:53+00:00
State: open

Hi there

I seem to be having an issue creating a geo spatial index with an altered range.

Here is my test code:

```javascript
var db = new Db('verve', new Server("127.0.0.1", 27017, {}));
db.open(function(err, db) {
db.collection('world', function(err,coll) {
coll.createIndex( { loc : "2d" } , { min : 0 , max : 500}, function() {
collection.insert({'loc':[500,500],'name': 'test'},{safe:true},function(err) {
if (!err) console.log(err);
});
}
}
}
```
This will always output:

```javascript
{ [MongoError: point not in interval of [ -180, 180 )]
name: 'MongoError',
err: 'point not in interval of [ -180, 180 )',
code: 13027,
n: 0,
connectionId: 81,
ok: 1 }
```

Suggesting that the index wasn't created with the correct range. Calling ensureIndex from the Mongo REPL creates the correct index.

If I'm doing something obviously wrong could you point it out?

Cheers

John