[DOCS-12834] Document that $geoWithin cannot contain multiple fields Created: 14/Jun/19 Updated: 30/Oct/23 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | Server |
| Affects Version/s: | 4.0.9 |
| Fix Version/s: | Server_Docs_20231030 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Mateusz Starzec | Assignee: | Unassigned |
| Resolution: | Won't Do | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: | |
| Days since reply: | 1 year, 14 weeks, 2 days ago |
| Description |
|
$geoWithin cannot contain an implicit $and and must only have one field. We should clearly indicate this in the documentation. There may be other operators that also need to be clarified. Original DescriptionParser rejects the following query:
with the following error:
Tested on Mongo 4.0.9 |
| Comments |
| Comment by Education Bot [ 31/Oct/22 ] | ||||||
|
Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you! | ||||||
| Comment by Danny Hatcher (Inactive) [ 26/Jun/19 ] | ||||||
|
After some internal discussions, we believe that the simple workaround of writing the query with an $and should be sufficient for most use-cases. For example, you could rewrite your query like so:
However, we should be more clear about the fact that $geoWithin cannot contain an implicit $and and must only have one field. I will convert this ticket to a Docs ticket to address this. | ||||||
| Comment by Danny Hatcher (Inactive) [ 21/Jun/19 ] | ||||||
|
Thanks for your report. We're looking into whether this behavior is working as intended or is something that should be fixed. I will update this ticket as soon as we decide. |