Does anyone have an example of how to use near in a query? I am getting the following error: "near must be first in: { $near: null }". It is requiring Float instead of coordinates and distance.
Haven't used the points field yet but you might need to update the where query to use
and
so a bit like this
where: {
and: [
{
status: {equals: 'ON' }
},
{
near: //...logic
}
]
}
excuse the formatting 😅
Hey @Rafael Nepomuceno I have used em a bunch, just format em like this:
coordinates: {
near: [
lng,
lat,
meters,
],
}
Wow! And that. I quickly tested it in graphql playground and it worked. Thank you very much. I was already connecting directly to mongo to solve this. 🤷♂️
Awesome, happy to help. Have fun!