Skip to content

Commit 0753518

Browse files
committed
Merge remote-tracking branch 'linusbrolin/query-middleware-support' into query-middleware-support
2 parents 48926a7 + 3bdcdee commit 0753518

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/sequence.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Sequence.prototype._setHooks = function() {
179179
if (err) return next();
180180
if (obj) return next();
181181
else {
182-
referenceValue = _this._getCounterReferenceField(_thisquery._update['$setOnInsert']);
182+
referenceValue = _this._getCounterReferenceField(_thisquery._update);
183183
_this._setNextCounter(_this._options.reference_fields, referenceValue, function(err, seq) {
184184
if (err) return next();
185185
_thisquery._update['$setOnInsert'] = _thisquery._update['$setOnInsert'] || {};
@@ -190,10 +190,6 @@ Sequence.prototype._setHooks = function() {
190190
});
191191
});
192192

193-
// this._schema.post('findOneAndUpdate', function(next) {
194-
// console.dir(this);
195-
// });
196-
197193
this._schema.pre('update', function(next, done) {
198194
// jscs:disable
199195
var _thisquery = this,
@@ -206,7 +202,7 @@ Sequence.prototype._setHooks = function() {
206202
if (err) return next();
207203
if (obj) return next();
208204
else {
209-
referenceValue = _this._getCounterReferenceField(_thisquery._update['$setOnInsert']);
205+
referenceValue = _this._getCounterReferenceField(_thisquery._update);
210206
_this._setNextCounter(_this._options.reference_fields, referenceValue, function(err, seq) {
211207
if (err) return next();
212208
_thisquery._update['$setOnInsert'] = _thisquery._update['$setOnInsert'] || {};

0 commit comments

Comments
 (0)