[SERVER-4817] with multiple equal, but not bit equivalent, values for a key, only one is stored in the index Created: 31/Jan/12  Updated: 06/Dec/22  Resolved: 06/Jan/17

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

Type: Bug Priority: Major - P3
Reporter: Aaron Staple Assignee: Backlog - Query Team (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Can cause problems when covered indexes are used, and likely in other scenarios.

> c.drop()
true
> c.save( {a:[0.0,NumberLong(0)]} )
> c.find( {a:0}, {a:1,_id:0} )
{ "a" : [ 0, NumberLong(0) ] }
> c.ensureIndex( {a:1} )
> c.find( {a:0}, {a:1,_id:0} )
{ "a" : 0 }

Probably doesn't make sense to allow multiple equal keys per doc in the short term, since without extra work that would break uniqueness of key,doc pairs which would would be bad for the btrees and likely other places. But we can try prevent bad results as in above.



 Comments   
Comment by Asya Kamsky [ 28/Dec/16 ]

This works correctly in current (and recent) versions.

Generated at Thu Feb 08 03:07:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.