Cannot upsert 16MB document from shell

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.5.5
    • Component/s: Shell
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Using the MongoDB 2.4.8 shell and OP_UPDATE, I can create a nearly-16MB document by upserting:

      > var sixteen = '';
      > while (sixteen.length < (16 * 1024 * 1024 - 30)) { var x = (sixteen += 'a'); }
      > sixteen.length
      16777186
      > db.collection.update({key: 1}, {$set: {x: sixteen}}, true)
      >
      

      But in nightly shell build bffe6421 with the 'update' command, this fails:

      > sixteen.length
      16777186
      > db.collection.update({key: 1}, {$set: {x: sixteen}}, true)
      2014-02-04T09:52:35.515-0500 Error: Converting from JavaScript to BSON failed: Object size 16777256 exceeds limit of 16777216 bytes. at src/mongo/shell/batch_api.js:347
      

              Assignee:
              DO NOT USE - Backlog - Platform Team
              Reporter:
              A. Jesse Jiryu Davis
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: