[SERVER-76875] Exclude fields containing dots from indexes Created: 05/May/23 Updated: 10/Nov/23 Resolved: 10/May/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.1.0-rc0, 7.0.0-rc1, 6.0.7 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Alberto Massari | Assignee: | Alberto Massari |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Assigned Teams: |
Query Execution
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||||||||||||||||||||||||||||||
| Backport Requested: |
v7.0, v6.3, v6.0
|
||||||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | QE 2023-05-15 | ||||||||||||||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||||||||||||||
| Linked BF Score: | 120 | ||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
When an index is defined on a path "obj.nested.field", it's supposed to index a document
However, it also indexes
as it looks evident in this testcase
where the created document
is using the content of the "inner.geoLegacy" field as a valid match for the indexed path "obj.inner.geoLegacy", and fails to treat it as a 2D legacy point.
Given that we document that fields whose name is starting with "$" or containing "." are not included in indexes or encrypted, we should skip them rather than including them and yield wrong results.
A maybe related issue is that the insertion of a dotted path matching the index key makes a document be excluded when the index is used, compared with when a collection scan is performed:
|
| Comments |
| Comment by Githook User [ 12/May/23 ] |
|
Author: {'name': 'Alberto Massari', 'email': 'alberto.massari@mongodb.com', 'username': 'albymassari'}Message: |
| Comment by Githook User [ 12/May/23 ] |
|
Author: {'name': 'Alberto Massari', 'email': 'alberto.massari@mongodb.com', 'username': 'albymassari'}Message: |
| Comment by Githook User [ 10/May/23 ] |
|
Author: {'name': 'Alberto Massari', 'email': 'alberto.massari@mongodb.com', 'username': 'albymassari'}Message: |