Skip to content

Commit d054a74

Browse files
linusbrolinramiel
authored andcommitted
Fixed bug where the reference value(s) would not be found
1 parent 490a1cf commit d054a74

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/sequence.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ Sequence.prototype._setHooks = function() {
207207
if (err) return next();
208208
if (obj) return next();
209209
else {
210-
referenceValue = _this._getCounterReferenceField(_thisquery._update['$setOnInsert']);
210+
referenceValue = _this._getCounterReferenceField(_thisquery._update);
211211
_this._setNextCounter(_this._options.reference_fields, referenceValue, function(err, seq) {
212212
if (err) return next();
213213
_thisquery._update['$setOnInsert'] = _thisquery._update['$setOnInsert'] || {};
@@ -231,7 +231,7 @@ Sequence.prototype._setHooks = function() {
231231
if (err) return next();
232232
if (obj) return next();
233233
else {
234-
referenceValue = _this._getCounterReferenceField(_thisquery._update['$setOnInsert']);
234+
referenceValue = _this._getCounterReferenceField(_thisquery._update);
235235
_this._setNextCounter(_this._options.reference_fields, referenceValue, function(err, seq) {
236236
if (err) return next();
237237
_thisquery._update['$setOnInsert'] = _thisquery._update['$setOnInsert'] || {};

0 commit comments

Comments
 (0)