Hi Markus,
My guess is, a normal 2D index treats the points like points on a flat 2D plane. This way, the box is a simple 2D box where you can just get the coordinates of the corners of the box and draw a straight line between them.
In contrast, $geoWithin places the box on a sphere, so you need to take into account the curvature of the sphere (the earth, in terms of geo queries). If you assume a sphere, then drawing a straight line across two points like in a flat 2D plane is not correct anymore. I’m guessing that some of the points you have are actually outside the box when you project the box onto a sphere.
If you don’t think this is the case, could you provide some example documents and the query itself?
Best regards,
Kevin
Hi,
Please post more details:
Best regards,
Kevin
Hi Markus,
What I tried is a flat 2D query versus a geo query.
Yes I understand that is the case. Could you post the actual queries and the documents so I can try to reproduce what you’re seeing?
Best regards,
Kevin