Update README.md

pull/2/head
Louis Chatriot 12 years ago
parent 4c3aa92a40
commit 62d257b9af
  1. 5
      README.md

@ -128,6 +128,11 @@ db.update({ planet: 'Pluton' }, { planet: 'Pluton', inhabited: false }, { upsert
// numReplaced = 1, upsert = true // numReplaced = 1, upsert = true
// A new document { _id: 'id5', planet: 'Pluton', inhabited: false } has been added to the collection // A new document { _id: 'id5', planet: 'Pluton', inhabited: false } has been added to the collection
}); });
// If you upsert with a modifier, the upserted doc is the query modified by the modifier
db.update({ planet: 'Pluton' }, { $set: { inhabited: false } }, { upsert: true }, function () {
// A new document { _id: 'id5', planet: 'Pluton', inhabited: false } has been added to the collection
});
``` ```

Loading…
Cancel
Save