Skip to content

Commit

Permalink
test: fix tests re: #5881
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Dec 8, 2017
1 parent 4f1e1a0 commit 1c3e210
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Document.prototype.$__buildDoc = function(obj, fields, skipId) {
while (ki--) {
// Does this projection explicitly define inclusion/exclusion?
// Explicitly avoid `$meta` and `$slice`
if (keys[ki] !== '_id' && isDefiningProjection(keys[ki])) {
if (keys[ki] !== '_id' && isDefiningProjection(fields[keys[ki]])) {
exclude = !fields[keys[ki]];
break;
}
Expand Down
3 changes: 1 addition & 2 deletions test/query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2412,8 +2412,7 @@ describe('Query', function() {
});

it('slice projection', function(done) {
MyModel.findOne({name: 'John'}, {dependents: {$slice: 1}}).
exec(function(error, person) {
MyModel.findOne({name: 'John'}, {dependents: {$slice: 1}}).exec(function(error, person) {
assert.ifError(error);
assert.equal(person.salary, 25000);
done();
Expand Down

0 comments on commit 1c3e210

Please sign in to comment.