Skip to content

Commit

Permalink
✨ Added another $and conjunction case
Browse files Browse the repository at this point in the history
refs TryGhost#5

- $and: [{'tags.slug': 'animal'},{'tags.slug': {$nin: ['classic']}}]
  • Loading branch information
kirrg001 committed Nov 16, 2018
1 parent faea7a9 commit 59a67f2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/integration/relations.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,20 @@ describe('Relations', function () {
result.should.be.an.Array().with.lengthOf(2);
});
});

it('tags.slug is animal and tags.slug not in []', function () {
const mongoJSON = {
$and: [{'tags.slug': 'animal'},{'tags.slug': {$nin: ['classic']}}]
};

const query = makeQuery(mongoJSON);

return query
.select()
.then((result) => {
result.should.be.an.Array().with.lengthOf(1);
});
});
});

describe('OR', function () {
Expand Down

0 comments on commit 59a67f2

Please sign in to comment.