Skip to content

Commit

Permalink
fix(query): don't treat projection with just $slice as inclusive
Browse files Browse the repository at this point in the history
Fix #5737
  • Loading branch information
vkarpov15 committed Nov 6, 2017
1 parent c40b313 commit c93fdae
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions lib/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -3839,17 +3839,12 @@ Query.prototype.selectedInclusively = function selectedInclusively() {

for (var i = 0; i < keys.length; ++i) {
var key = keys[i];
if (this._fields[key] === 0 || this._fields[key] === false) {
return false;
}
if (this._fields[key] &&
typeof this._fields[key] === 'object' &&
this._fields[key].$meta) {
return false;
if (typeof this._fields[key] !== 'object' && !!this._fields[key]) {
return true;
}
}

return true;
return false;
};

/**
Expand Down

0 comments on commit c93fdae

Please sign in to comment.