I have 2dSphere index on bikes.loc field
My following query works fine in mongo shell
db.bikes.find({
fromDate: {
$lte: ISODate("2014-10-11T00:01:00Z")
},
toDate: {
$gte: ISODate("2014-10-12T05:05:00Z")
},
bikeType: "Road",
loc: {
$near: {
$geometry: {
type: "Point",
coordinates: [
-121.8867076,
37.3357192
]
},
$maxDistance: 10
}
}
});
However in cashbah for scala $maxDistance is not recognized
("loc" $nearSphere(long, lat) $maxDistance 10)
Scala Version 2.11.2
Casbah dependency in gradle org.mongodb:casbah_2.11:2.7.3
Is the bug still open?
It would appear not. But you should be using the
$near
operator here instead. This is the example test in the source distribution:That listing is taken as of the 2.7.3 release
So this is supported in the query DSL, but as noted in the test conditions, even if the