Why the CountDocuments doesn't support $geoNear

Hi James,

The filter parameter for CountDocuments becomes a $match aggregate stage. Because $geoNear is also an aggregation stage, it cannot be used inside of the $match one.

To do this, you can use Collection.Aggregate rather than Collection.CountDocuments. Your aggregation would have two stages: $geoNear and $count to output the number of documents found.