Tuesday, November 22, 2016

With unordered inserts, if an error occurs during an insert of one of the documents, MongoDB continues to insert the remaining documents in the array.
db.products.insert(
   [
     { _id: 200, item: "lamp", qty: 50, type: "desk" },
     { _id: 200, item: "lamp", qty: 20, type: "floor" },
     { _id: 220, item: "bulk", qty: 100 }
   ],
   { ordered: false }
)

No comments:

Post a Comment