diff --git a/lib/datastore.js b/lib/datastore.js index c1788bd..57dccc6 100755 --- a/lib/datastore.js +++ b/lib/datastore.js @@ -610,12 +610,7 @@ class Datastore extends EventEmitter { // Update the datafile const updatedDocs = modifications.map(x => x.newDoc) - await new Promise((resolve, reject) => { - this.persistence.persistNewState(updatedDocs, err => { - if (err) return reject(err) - else resolve() - }) - }) + await this.persistence.persistNewStateAsync(updatedDocs) if (!options.returnUpdatedDocs) return { numAffected: numReplaced } else { let updatedDocsDC = []