|
|
@ -610,12 +610,7 @@ class Datastore extends EventEmitter { |
|
|
|
|
|
|
|
|
|
|
|
// Update the datafile
|
|
|
|
// Update the datafile
|
|
|
|
const updatedDocs = modifications.map(x => x.newDoc) |
|
|
|
const updatedDocs = modifications.map(x => x.newDoc) |
|
|
|
await new Promise((resolve, reject) => { |
|
|
|
await this.persistence.persistNewStateAsync(updatedDocs) |
|
|
|
this.persistence.persistNewState(updatedDocs, err => { |
|
|
|
|
|
|
|
if (err) return reject(err) |
|
|
|
|
|
|
|
else resolve() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
if (!options.returnUpdatedDocs) return { numAffected: numReplaced } |
|
|
|
if (!options.returnUpdatedDocs) return { numAffected: numReplaced } |
|
|
|
else { |
|
|
|
else { |
|
|
|
let updatedDocsDC = [] |
|
|
|
let updatedDocsDC = [] |
|
|
|