Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
crcn committed Feb 15, 2022
1 parent 4d9af51 commit b418188
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/basic-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,4 +564,25 @@ describe(__filename + "#", function() {
sift({ $nor: [] });
}, new Error("$and/$or/$nor must be a nonempty array"));
});

it(`supports implicit $and`, () => {
const result = [
{
tags: ["animal", "dog"]
},
{
tags: ["animal", "cat"]
},
{
tags: ["animal", "mouse"]
}
].filter(
sift({
tags: {
$in: ["animal"],
$nin: ["mouse"]
}
})
);
});
});

0 comments on commit b418188

Please sign in to comment.