[SERVER-79218] geoWithin: Data not being returned for points in bounds Created: 21/Jul/23  Updated: 24/Jul/23  Resolved: 24/Jul/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Khalid Bashir Bajwa Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-78343 geoWithin not returning correct data Closed
Operating System: ALL
Steps To Reproduce:

Create sample data

db.geo_json_test.insertMany([{name: "001A", location: {type: "Point", coordinates: [-58.4473758, -34.5763659],{name: "001B", location: {type: "Point", coordinates: [-58.4473606, -34.5763057]}},{name: "001C", location: {type: "Point", coordinates: [-58.4473746, -34.5763513]}},{name: "001D", location: {type: "Point", coordinates: [-58.4474213, -34.5763618]}}])}}

 

Query returning all points

db.geo_json_test.find({'$and': [{'location': {'$geoWithin': {'$geometry': {'type': 'Polygon', 'coordinates': [[[23,0],[-133,0],[-133,-36],[23,-36],[23,0]]]}}]})}}

 

Query not returning any point

db.geo_json_test.find({'$and': [{'location': {'$geoWithin': {'$geometry': {'type': 'Polygon', 'coordinates': [[[26,-12],[-126,-12],[-126,-42],[26,-42],[26,-12]]]}}]})}}

Participants:

 Description   

I have the data attached in this ticket. Corresponding queries are also attached in Steps to reproduce.  

geoWithin query doesn't return data even when the bounds seem to enclose the data. Can you please help. This is being used in an application where the map bounds are being used to get data from MongoDB. However, the behavior is not deterministic.

Server version: 6.0.8 Community

 



 Comments   
Comment by Khalid Bashir Bajwa [ 24/Jul/23 ]

Thank you. Yes the issue is quite similar. I'll keep on watching https://jira.mongodb.org/browse/SERVER-78343.

Comment by Yuan Fang [ 24/Jul/23 ]

Hi khalidbashirbajwa@gmail.com,

Thank you for your report. It appears that this issue is a duplicate of SERVER-78343, which is currently under investigation by the server team. Your patience and understanding are highly appreciated during this process. I will close this ticket, and please watch SERVER-78343 for any further updates.

Regards,
Yuan

Generated at Thu Feb 08 06:40:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.