Reputation: 413
usercollection.find({
"device_info.location" :
$geoWithin : { $centerSphere :[[_latitude, _longitude] , 100/3959]}}},
function (err, result) {
if (err) callback(err) else callback(null, result)
});
As you can see it is a simple query for fetching documents that meet the location criteria, this works perfectly fine if I change this to findOne however in this case it just returns {}. The same query works perfectly fine when executed from the terminal. There are two records that are within this range and show up on the terminal as well.
Is there some specific reason why it behaves like this with find()?
Upvotes: 0
Views: 50