From 45de351fea38898ad2cab3731b0851c133efc803 Mon Sep 17 00:00:00 2001 From: Louis Chatriot Date: Thu, 16 May 2013 17:10:08 +0200 Subject: [PATCH] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bc20685..9f37698 100644 --- a/README.md +++ b/README.md @@ -101,9 +101,14 @@ db.findOne({ _id: 'id1' }, function (err, doc) { db.update({ planet: 'Jupiter' }, { planet: 'Pluton'}, {}, function (err, numReplaced) { // numReplaced = 1 // The doc #3 has been replaced by { _id: 'id3', planet: 'Pluton' } - // Note that the _id has not been modified + // Note that the _id is kept unchanged, and the document has been replaced + // (the 'system' field is not here anymore) }); +db.update({ system: 'solar' }, { $set: { system: 'solar system' } }, { multi: true }, function (err, numResult) { + // numResult = 3 + // Field 'system' on Mars, Earth, Jupiter now has value 'solar system' +}); ```