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

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.6.0-rc2
    • 2.5.5
    • 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

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: