I have the following code :
MongoClient m = new MongoClient();
var db = m.GetDatabase("PopupRentals");
string cmdDoc = (@"
db.Rentals.find({polygons:
{$geoIntersects:
{$geometry:{ 'type' : 'Point',
'coordinates' : [ 17.3734, 78.4738 ]
}
}
}
});");
var cmd = new JsonCommand<BsonDocument>(cmdDoc);
var res = db.RunCommand(cmd);
var result = db.GetCollection<RentalProperty>("Rentals");
I am using the standard mongodb v2 driver.
Once i execute the query i get the following error at about the
db.RunCommand(cmd);
System.FormatException: 'JSON reader was expecting a value but found 'db'.'
I have not the slightest clue why this is not working. It works great in Robo.