[SERVER-35220] Updating a document with dotted notation failed with PathNotViable if array is sufficiently large Created: 25/May/18 Updated: 26/Jun/20 Resolved: 08/Jun/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying, Write Ops |
| Affects Version/s: | 3.6.4 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kevin Adistambha | Assignee: | Charlie Swanson |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||
| Issue Links: |
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Sprint: | Query 2018-06-18 | ||||||||||||
| Participants: | |||||||||||||
| Description |
Attached is a jstest that creates an empty array, then attempts to insert 10 new elements into the array using dotted notation such as {$set: {"array.0.content": "x"}}: PathNotViable.js The test will fail if we attempt to insert 10 elements at once. It will succeed when we try to insert fewer than that, e.g. 9 elements. The error message printed in the console is as follows:
This also happens when inserting the same number of elements using Pymongo. |
| Comments |
| Comment by Charlie Swanson [ 08/Jun/18 ] | ||||||||
|
Hi kevin.adistambha, It looks like you're running into In your example, supposing you actually want to update all of the elements in the array, I think you could do so via
If you want to go from an empty array to an array with 10 elements, could you just manually create the array yourself? Something like
|