I'm getting
MongoServerError: $geoNear, $near, and $nearSphere are not allowed in this context
while trying to query by location and some other fields at the same time. Any ideas what might be causing this?
My query (before qs.stringify())
{
and: [
//ourselves
{id: {
not_equals: options.userTeam.id
}},
//teams we've already matched with
//teams we've declined
//teams that have declined us.
//teams that have already matched with us
{id: {
not_in: teamIDsToIgnore
}},
//teams outside of our radius
{location: {
near: [
options.userTeam.location[0],
options.userTeam.location[1],
1000*options.radius,
0
]
}}
]
}