If a multi update fails on one docs, the others shouldnt be changed

pull/2/head
Louis Chatriot 11 years ago
parent 7816a11807
commit bf0a0c8547
  1. 2
      lib/datastore.js

@ -427,12 +427,14 @@ Datastore.prototype._update = function (query, updateQuery, options, cb) {
return callback(err);
}
// Change the docs in memory
try {
self.updateIndexes(modifications);
} catch (err) {
return callback(err);
}
// Update the datafile
self.persistence.persistNewState(_.pluck(modifications, 'newDoc'), function (err) {
if (err) { return callback(err); }
return callback(null, numReplaced);

Loading…
Cancel
Save