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

Cannot upsert 16MB document from shell

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

      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:
            backlog-server-platform DO NOT USE - Backlog - Platform Team
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: