Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-35220

Updating a document with dotted notation failed with PathNotViable if array is sufficiently large

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.6.4
    • Component/s: Querying, Write Ops
    • None
    • ALL
    • Query 2018-06-18

      1. Attempting to update an array using dotted notation failed with a PathNotViable error (code 28) if the array is sufficiently large.

      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:

      Cannot create field 'content' in element {: null}
      WriteResult({
        "nMatched": 0,
        "nUpserted": 0,
        "nModified": 0,
        "writeError": {
          "code": 28,
          "errmsg": "Cannot create field 'content' in element {: null}"
        }
      })
      

       This also happens when inserting the same number of elements using Pymongo.

            Assignee:
            charlie.swanson@mongodb.com Charlie Swanson
            Reporter:
            kevin.adistambha@mongodb.com Kevin Adistambha
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: