Add check for property (#7421)

* Add check for property

* updated changelog

* Fixed logic returning false positive

* Added test case

* update change log
This commit is contained in:
Jason Posthuma
2021-06-22 01:11:15 +02:00
committed by GitHub
parent 3a2afda911
commit d8dc524c08
3 changed files with 14 additions and 0 deletions

View File

@@ -313,6 +313,16 @@ describe('matchesQuery', function () {
expect(matchesQuery(player, orQuery)).toBe(true);
});
it('does not match $all query when value is missing', () => {
const player = {
id: new Id('Player', 'P1'),
name: 'Player 1',
score: 12,
};
const q = { missing: { $all: [1, 2, 3] } };
expect(matchesQuery(player, q)).toBe(false);
});
it('matches an $and query', () => {
const player = {
id: new Id('Player', 'P1'),