Skip to content

Commit

Permalink
Update lib/query.js
Browse files Browse the repository at this point in the history
Co-authored-by: Sean Derrow <sean.derrow@gmail.com>
  • Loading branch information
vkarpov15 and sderrow committed May 9, 2024
1 parent a20eaa8 commit 2c0f63b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -2382,11 +2382,10 @@ Query.prototype.merge = function(source) {
opts.omit = {};
if (source.$and) {
opts.omit['$and'] = true;
if (this._conditions && this._conditions.$and) {
this._conditions.$and = this._conditions.$and.concat(source.$and);
} else {
this._conditions.$and = [...source.$and];
if (!this._conditions) { // maybe unnecessary?

Check failure on line 2385 in lib/query.js

View workflow job for this annotation

GitHub Actions / Lint JS-Files

Multiple spaces found before '// maybe unnec...'

Check failure on line 2385 in lib/query.js

View workflow job for this annotation

GitHub Actions / Lint JS-Files

Multiple spaces found before '// maybe unnec...'
this._conditions = {};
}
this._conditions.$and = (this._conditions.$and || []).concat(source.$and);
}
if (source.$or) {
opts.omit['$or'] = true;
Expand Down

0 comments on commit 2c0f63b

Please sign in to comment.