-
Type: Question
-
Resolution: Incomplete
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Geo
-
None
I haven't use the $geoNear in my query instead I have used $near. But this is showing the error of $geoNear. And the error create the interruption in processing the query. Not always but once in every hour.
I have used '2dsphere' index already---
scheduleRideSchema.index({ source: '2dsphere' });
{{ $or: [{ $or: [{ $and: [{ pickupStart:
}, { pickupEnd:
{ $lte: pickupStartTime }}] },{ $and: [{ pickupStart:
{ $gte: pickupStartTime }}, { pickupEnd:
{ $lte: pickupEndTime }}] }]}, { $or: [{ $and: [{ pickupStart:
{ $lte: pickupStartTime }}, { pickupEnd:
{ $gte: pickupStartTime }}] },{ $and: [{ pickupStart:
{ $lte: pickupStartTime }}, { pickupEnd:
{ $gte: pickupEndTime }}] }]}]}, { $and:[{ source:{ $near:{ $geometry:
{ type: "Point", coordinates: sourceCord.coordinates }, $maxDistance: 4000}}},{$and:[
{cancel:false},
{ complete:false}]}]}]});}}