insert of array of documents fails in shell for array 1000+ and gives bad error message

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.6.0-rc0
    • Component/s: Shell, Write Ops
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      write@local(2.6.0-rc0) > batch1.length
      1000
      write@local(2.6.0-rc0) > db.collection.insert(batch1)
      2014-02-24T11:23:02.156-0800 Error: Cannot output SingleWriteResult from multiple batch result at src/mongo/shell/bulk_api.js:253
      write@local(2.6.0-rc0) > batch1.length=999
      999
      write@local(2.6.0-rc0) > db.collection.insert(batch1)
      WriteResult({ "nInserted" : 999 })
      

      The issue is that in insert prototype it does:
      result = batch.execute(wc).toSingleResult();
      and a single batch is limited to 1000 documents (supposedly, it turns out to be 999 so maybe off by one here).

            Assignee:
            Andreas Nilsson (Inactive)
            Reporter:
            Asya Kamsky
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: