Details
-
Bug
-
Resolution: Won't Fix
-
Major - P3
-
None
-
2.7.2
-
None
Description
We used to be able to do the following in version 2.4 :
var filter = Query<TEntity>.Near(field, point, rangeInMeters);
|
var query = collection.AsQueryable().Where(x => locationClause.Inject());
|
Now in 2.7, when we do this :
var filter = Builders<TEntity>.Filter.Near(field, point, rangeInMeters);
|
var query = collection.AsQueryable().Where(x => filter.Inject());
|
we get the following error:
$near is not allowed inside of a $match aggregation
Query being injected:
{ "$match" : { "Location" : { "$near" : { "$geometry" : { "type" : "Point", "coordinates" : [-73.656500000000008, 45.567100000000003] }, "$maxDistance" : 10000.0 } } } } |