Closed alimoli closed 2 years ago
I would like to paginate something very easy like the following find call using this library.
find
const docs = await MyModel.find({ location: { $nearSphere: { $geometry: { type: "Point", coordinates: [location?.latitude, location?.longitude] } } } })
Using this library:
const { docs, hasNext, next } = await MerchantModel.findPaged({ limit: pagination?.first || undefined, next: pagination?.after || undefined }, { location: { $near: { $geometry: { type: "Point", coordinates: [location?.latitude, location?.longitude] } } } })
However, using findPaged I get the following error: $geoNear, $near, and $nearSphere are not allowed in this context.
findPaged
$geoNear, $near, and $nearSphere are not allowed in this context.
I have updated all dependencies, can you check if this is now fixed?
I would like to paginate something very easy like the following
find
call using this library.Using this library:
However, using
findPaged
I get the following error:$geoNear, $near, and $nearSphere are not allowed in this context.