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).
- duplicates
-
SERVER-12763 Shell insert method provides confusing error message when inserting many objects.
- Closed