diff --git a/lib/datastore.js b/lib/datastore.js index 5a4aa24..26a58ac 100644 --- a/lib/datastore.js +++ b/lib/datastore.js @@ -337,7 +337,12 @@ Datastore.prototype._persistNewState = function (newDocs, cb) { }); }; Datastore.prototype.persistNewState = function (newDocs, cb) { - this._persistNewState(newDocs, cb); + if (this.pipeline) { + this.persistenceExecutor.push({ this: this, fn: this._persistNewState, arguments: [newDocs] }); + cb (); // Return right away with no error + } else { + this._persistNewState(newDocs, cb); + } };