Skip to content

Commit 72d21a8

Browse files
committed
fix(mquery): rename cache "_update" to "_updateDoc" to not conflict with the function
1 parent 52198d8 commit 72d21a8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

lib/mquery.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ function Query(criteria, options) {
4141
? utils.clone(proto._fields)
4242
: undefined;
4343

44-
this._update = proto._update
45-
? utils.clone(proto._update)
44+
this._updateDoc = proto._updateDoc
45+
? utils.clone(proto._updateDoc)
4646
: undefined;
4747

4848
this._path = proto._path || undefined;
@@ -130,7 +130,7 @@ Query.prototype.toConstructor = function toConstructor() {
130130
p.op = this.op;
131131
p._conditions = utils.clone(this._conditions);
132132
p._fields = utils.clone(this._fields);
133-
p._update = utils.clone(this._update);
133+
p._updateDoc = utils.clone(this._updateDoc);
134134
p._path = this._path;
135135
p._distinct = this._distinct;
136136
p._collection = this._collection;
@@ -1859,9 +1859,9 @@ Query.prototype.merge = function(source) {
18591859
utils.merge(this.options, source.options);
18601860
}
18611861

1862-
if (source._update) {
1863-
this._update || (this._update = {});
1864-
utils.mergeClone(this._update, source._update);
1862+
if (source._updateDoc) {
1863+
this._updateDoc || (this._updateDoc = {});
1864+
utils.mergeClone(this._updateDoc, source._updateDoc);
18651865
}
18661866

18671867
if (source._distinct) {
@@ -2747,13 +2747,13 @@ Query.prototype.selectedExclusively = function selectedExclusively() {
27472747
*/
27482748

27492749
Query.prototype._mergeUpdate = function(doc) {
2750-
if (!this._update) this._update = {};
2750+
if (!this._updateDoc) this._updateDoc = {};
27512751
if (doc instanceof Query) {
2752-
if (doc._update) {
2753-
utils.mergeClone(this._update, doc._update);
2752+
if (doc._updateDoc) {
2753+
utils.mergeClone(this._updateDoc, doc._updateDoc);
27542754
}
27552755
} else {
2756-
utils.mergeClone(this._update, doc);
2756+
utils.mergeClone(this._updateDoc, doc);
27572757
}
27582758
};
27592759

@@ -2787,7 +2787,7 @@ Query.prototype._fieldsForExec = function() {
27872787
*/
27882788

27892789
Query.prototype._updateForExec = function() {
2790-
const update = utils.clone(this._update);
2790+
const update = utils.clone(this._updateDoc);
27912791
const ops = utils.keys(update);
27922792
const ret = {};
27932793

0 commit comments

Comments
 (0)