[SERVER-46695] Allow arrays creation during new record upsert when specifying dotted sub-paths inside $set:{} command Created: 06/Mar/20 Updated: 10/Mar/20 Resolved: 10/Mar/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Write Ops |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor - P4 |
| Reporter: | Maximus N/A | Assignee: | Carl Champain (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
Currently, mongoDB server creates object/hash by default during new record/element insertion when using dotted sub-paths inside $set:{} command:
In this case, the following record is created: } However, if the record is already created with doc=[] (array) element then the above update leads to an array update procedure. MongoDB server should not desire by default that the doc is an object {} during record/element creation, because it can be an array too. Please add a new option like "CreateArrayOnInsert:true" so mongoDB server can create arrays[] if the element/record doesn't exist, like this:
-> this should create a record with the following elements: { "_id":<XXX>, ... , "doc" : [ null, <doc-data> ] } |
| Comments |
| Comment by Carl Champain (Inactive) [ 10/Mar/20 ] |
|
Sorry, I think this ticket is actually a duplicate of SERVER-13478 (I linked it as related to SERVER-13478 at first). Hence, I will close this one. If you really think this is not a duplicate, feel free to reopen and explain why. Thank you, |
| Comment by Carl Champain (Inactive) [ 10/Mar/20 ] |
|
Thanks for the report. Kind regards, |