Skip to content

Commit cc10e0d

Browse files
committed
test(query): repro #8222
1 parent ede5aef commit cc10e0d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/query.test.js

+9
Original file line numberDiff line numberDiff line change
@@ -3550,4 +3550,13 @@ describe('Query', function() {
35503550
});
35513551
});
35523552
});
3553+
3554+
it('query with top-level _bsontype (gh-8222)', function() {
3555+
const userSchema = Schema({ token: String });
3556+
const User = db.model('gh8222', userSchema);
3557+
3558+
return User.create({ token: 'rightToken' }).
3559+
then(() => User.findOne({ token: 'wrongToken', _bsontype: 'a' })).
3560+
then(doc => assert.ok(!doc));
3561+
});
35533562
});

0 commit comments

Comments
 (0)