[SERVER-2028] Null values should (optionally) be ignored by unique indexes Created: 29/Oct/10 Updated: 17/Jul/11 Resolved: 29/Oct/10 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Index Maintenance |
| Affects Version/s: | 1.7.1 |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor - P4 |
| Reporter: | Remon van Vliet | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
All |
||
| Participants: |
| Description |
|
The documentation states : This is very unpractical in a lot of situations and Mongo should offer the option to allow a field indexed with a uniquess constraint to be null for more than one document. Something like ensureIndex( {firstname: 1, lastname: 1}, {unique: true, multipleNulls:true}would be nice and it should be fairly trivial to add. |
| Comments |
| Comment by Eliot Horowitz (Inactive) [ 17/Jul/11 ] |
|
@federico, look at linked |
| Comment by Federico Grillini [ 15/Jul/11 ] |
|
Hi, Thanks a lot! |
| Comment by Eliot Horowitz (Inactive) [ 29/Oct/10 ] |