MongoDB shell version: 1.8.1 connecting to: test > show dbs admin (empty) blog_testing (empty) local (empty) mydb 0.078125GB ondot 0.203125GB payment 0.203125GB test 0.203125GB things 0.203125GB > use places switched to db places > db.places.insert({name:"AB",loc:[22.82,84.32]}) > db.places.insert({name:"CD",loc:[21.34,83.10])) Fri May 20 12:01:10 SyntaxError: missing } after property list (shell):1 > db.places.insert({name:"CD",loc:[21.34,83.10]}) > db.places.ensureIndex({loc:"2d"}) > db.places.find({loc:{$near:[22.82,84.32]}}) error: { "$err" : "invalid operator: $near" } > db.places.find({loc:{near:[22.82,84.32]}}) > db.places.find({loc:{geoNear:[22.82,84.32]}}) > db.places.find() { "_id" : ObjectId("4dd60a7b5492efa8a8326476"), "name" : "AB", "loc" : [ 22.82, 84.32 ] } { "_id" : ObjectId("4dd60abd5492efa8a8326477"), "name" : "CD", "loc" : [ 21.34, 83.1 ] } > db.places.find({geoNear : "places" , near : [22.82,84.32] }) > db.places.find({loc:{near:[22,84]}}) > db.places.find({loc:{$near:[22,84]}}) error: { "$err" : "invalid operator: $near" } > polygonA = [ [ 10, 20 ], [ 10, 40 ], [ 30, 40 ], [ 30, 20 ] ] [ [ 10, 20 ], [ 10, 40 ], [ 30, 40 ], [ 30, 20 ] ] > polygonB = { a : { x : 10, y : 20 }, b : { x : 15, y : 25 }, c : { x : 20, y : 20 } } { "a" : { "x" : 10, "y" : 20 }, "b" : { "x" : 15, "y" : 25 }, "c" : { "x" : 20, "y" : 20 } } > db.places.find({ "loc" : { "$within" : { "$polygon" : polygonA } } }) error: { "$err" : "invalid operator: $within" }