Getting geospatial indexes to work in MongoDB 1.4.3
-
28-09-2019 - |
Question
I wanted to try geospatial indexes with MongoDB, but all I get is
> db.map_nodes.find( { coodinate: { $near: [54, 10] } } )
error: { "$err" : "invalid operator: $near" }
and
> db.map_nodes.runCommand({geoNear:"coordinates", near:[50,50]})
{
"errmsg" : "no such cmd",
"bad cmd" : {
"geoNear" : "coordinates",
"near" : [
50,
50
]
},
"ok" : 0
}
I am using MongoDB 1.4.3. What am I doing wrong?
Solution
are you positive you're on 1.4? can you try db.version() from the shell?
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow