[SERVER-47935] findOneAndUpdate and update insert objects instead of arrays despite using array indexes in paths Created: 25/Nov/19 Updated: 05/May/20 Resolved: 05/May/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | R D | Assignee: | Carl Champain (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
The above code will create `status.type` as an `Object`, whereas this command when run in a shell:
Will create `status.type` as an Array.
db.isMaster() results:
|
| Comments |
| Comment by Carl Champain (Inactive) [ 05/May/20 ] | |||||||||
|
Thank you for the report. However, this should accomplish what you are looking for:
I will now close this ticket since this is a behavior that we are already aware of. If you need further assistance troubleshooting, I encourage you to ask our community by posting on the MongoDB Community Forums or on Stack Overflow with the mongodb tag. Kind regards, | |||||||||
| Comment by R D [ 26/Nov/19 ] | |||||||||
|
May actually have been wrong, running the command in the shell seems to exhibit the same behaviour, so it may be a problem with mongodb itself. |