[SERVER-28055] How does mongodb guarantee the compound index order with javascript un-ordered object literal creation? Created: 19/Feb/17 Updated: 24/Feb/17 Resolved: 24/Feb/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | Roben | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
Such as db.products.createIndex( { "item": 1, "stock": 1 } ) |
| Comments |
| Comment by Mark Agarunov [ 24/Feb/17 ] |
|
Hello narychen, Thanks for your report. While you are correct that the ECMAScript specification does not specfify the ordering or enumeration of an object's properties, the specific implementation used in the context of the index is ordered in MongoDB's query interface. If you would like to get more information about the specific implementation details of MongoDB's interface, consider making a post on the MongoDB Developer User Group. Please note that SERVER project is for reporting bugs or feature suggestions for the MongoDB server. For MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag. A question like this involving more discussion would be best posted on the mongodb-user group. Thanks, |