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

Shell insert method provides confusing error message when inserting many objects.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.6.0-rc2
    • Affects Version/s: 2.5.5
    • Component/s: Shell
    • ALL
    • Hide
      toInsert = [];
      for (i = 0; i < 100 * 1000; ++i) { toInsert.push({_id: i, a: 1}) }
      db.foo.insert(toInsert);
      

      Expected result: A WriteResult object.
      Actual:
      Message is logged to console:

      2014-02-18T11:00:51.406-0500 Cannot output SingleWriteResult from multiple batch result at src/mongo/shell/bulk_api.js:245
      
      Show
      toInsert = []; for (i = 0; i < 100 * 1000; ++i) { toInsert.push({_id: i, a: 1}) } db.foo.insert(toInsert); Expected result: A WriteResult object. Actual: Message is logged to console: 2014-02-18T11:00:51.406-0500 Cannot output SingleWriteResult from multiple batch result at src/mongo/shell/bulk_api.js:245

      If you try to insert a large number of objects using the insert([]) method on a collection in the shell, you get back a confusing error message:

      2014-02-18T11:00:51.406-0500 Cannot output SingleWriteResult from multiple batch result at src/mongo/shell/bulk_api.js:245
      

            Assignee:
            andreas.nilsson Andreas Nilsson
            Reporter:
            schwerin@mongodb.com Andy Schwerin
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: