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

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

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

      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 Andreas Nilsson
            Reporter:
            asya.kamsky@mongodb.com Asya Kamsky
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: