[SERVER-37198] Add tests for $arrayToObject behaviour when two keys are identical Created: 19/Sep/18 Updated: 06/Dec/22 Resolved: 12/Oct/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Jakub Szypulka | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | aggregation-framework, test, testing, tests | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query
|
||||||||
| Participants: | |||||||||
| Description |
|
According to the documentation, when $arrayToObject is used on an array where some keys repeat, the value of the first key is used. However, as far as I can see, this behaviour is not being tested for in the jstests integration test. I propose adding the following test to jstests/aggregation/expressions/arrayToObject.js:
|
| Comments |
| Comment by Ian Boros [ 12/Oct/18 ] |
|
Hi jaksz. Thanks for your pull request! Fortunately a test similar to yours was committed as part of |
| Comment by David Storch [ 12/Oct/18 ] |
|
ian.boros, can you take a look at the linked pull request? This relates to your work in |
| Comment by Nick Brewer [ 19/Sep/18 ] |
|
jaksz Thanks for your contribution. I'm leaving this ticket open for now - we'll revisit it based on the outcome of -Nick |
| Comment by Jakub Szypulka [ 19/Sep/18 ] |