views:

35

answers:

1

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?

+2  A: 

are you positive you're on 1.4? can you try db.version() from the shell?

mdirolf
Indeed, some serious fuckup within my loadpaths. While mongod --version returned 1.4.3, db.version returned 1.2. Thanks for the `db.version()` hint.
Marcel J.