Skip to content

Commit c93fdae

Browse files
committed
fix(query): don't treat projection with just $slice as inclusive
Fix #5737
1 parent c40b313 commit c93fdae

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/query.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3839,17 +3839,12 @@ Query.prototype.selectedInclusively = function selectedInclusively() {
38393839

38403840
for (var i = 0; i < keys.length; ++i) {
38413841
var key = keys[i];
3842-
if (this._fields[key] === 0 || this._fields[key] === false) {
3843-
return false;
3844-
}
3845-
if (this._fields[key] &&
3846-
typeof this._fields[key] === 'object' &&
3847-
this._fields[key].$meta) {
3848-
return false;
3842+
if (typeof this._fields[key] !== 'object' && !!this._fields[key]) {
3843+
return true;
38493844
}
38503845
}
38513846

3852-
return true;
3847+
return false;
38533848
};
38543849

38553850
/**

0 commit comments

Comments
 (0)