Skip to content

Commit

Permalink
test(query): repro #8222
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Oct 9, 2019
1 parent ede5aef commit cc10e0d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3550,4 +3550,13 @@ describe('Query', function() {
});
});
});

it('query with top-level _bsontype (gh-8222)', function() {
const userSchema = Schema({ token: String });
const User = db.model('gh8222', userSchema);

return User.create({ token: 'rightToken' }).
then(() => User.findOne({ token: 'wrongToken', _bsontype: 'a' })).
then(doc => assert.ok(!doc));
});
});

0 comments on commit cc10e0d

Please sign in to comment.