Skip to content
This repository has been archived by the owner on Mar 1, 2022. It is now read-only.

Support negation #7

Closed
3 tasks done
kirrg001 opened this issue Nov 8, 2018 · 1 comment
Closed
3 tasks done

Support negation #7

kirrg001 opened this issue Nov 8, 2018 · 1 comment
Assignees
Labels

Comments

@kirrg001
Copy link
Contributor

kirrg001 commented Nov 8, 2018

Description

NQL should support negation.
There are various combinations where you can use negation.

e.g. You can pass a filter into NQL

  • filter=-slug:en (same table negation)
  • filter=-tag:en+-tag:de (negation for relations)

mongo-knex has to receive mongo JSON objects and interpret the object correctly.

Tasks

  • support one case
  • add implementation for relation negation
  • add implementation same table negation

Add a test case and the assertion first and see if it passes.

kirrg001 added a commit to kirrg001/mongo-knex that referenced this issue Nov 15, 2018
kirrg001 added a commit to kirrg001/mongo-knex that referenced this issue Nov 15, 2018
kirrg001 added a commit to kirrg001/mongo-knex that referenced this issue Nov 16, 2018
refs TryGhost#5, refs TryGhost#7

- (tags.slug = animal and sort_order = 0) OR visibility:internal (group)
- tags.slug = animal OR sort_order = 0 OR visibility:internal
- (tags.slug is animal and sort_order is 0) and tags.visibility=public (group)
- tags.slug is animal and sort_order is 0 and tags.visibility=public
kirrg001 added a commit to kirrg001/mongo-knex that referenced this issue Nov 16, 2018
refs TryGhost#5, refs TryGhost#7

- (tags.slug = animal and sort_order = 0) OR visibility:internal (group)
- tags.slug = animal OR sort_order = 0 OR visibility:internal
- (tags.slug is animal and sort_order is 0) and tags.visibility=public (group)
- tags.slug is animal and sort_order is 0 and tags.visibility=public
kirrg001 added a commit to kirrg001/mongo-knex that referenced this issue Nov 16, 2018
kirrg001 added a commit to kirrg001/mongo-knex that referenced this issue Nov 16, 2018
refs TryGhost#5, refs TryGhost#7

- (tags.slug = animal and sort_order = 0) OR visibility:internal (group)
- tags.slug = animal OR sort_order = 0 OR visibility:internal
- (tags.slug is animal and sort_order is 0) and tags.visibility=public (group)
- tags.slug is animal and sort_order is 0 and tags.visibility=public
kirrg001 added a commit to kirrg001/mongo-knex that referenced this issue Nov 16, 2018
refs TryGhost#5, refs TryGhost#7

- (tags.slug = animal and sort_order = 0) OR visibility:internal (group)
- tags.slug = animal OR sort_order = 0 OR visibility:internal
- (tags.slug is animal and sort_order is 0) and tags.visibility=public (group)
- tags.slug is animal and sort_order is 0 and tags.visibility=public
kirrg001 added a commit that referenced this issue Nov 16, 2018
kirrg001 added a commit that referenced this issue Nov 16, 2018
refs #5, refs #7

- (tags.slug = animal and sort_order = 0) OR visibility:internal (group)
- tags.slug = animal OR sort_order = 0 OR visibility:internal
- (tags.slug is animal and sort_order is 0) and tags.visibility=public (group)
- tags.slug is animal and sort_order is 0 and tags.visibility=public
naz added a commit that referenced this issue Dec 4, 2018
…lations (#18)

refs #5
refs #7

- Improved group comparison operator check
- Improved negation handling in conjunctions that have conditions on the connecting table
- Added test cases where one of the properties is negated
- Added support for negation inside $and conjunction with joining table condition
@naz
Copy link
Contributor

naz commented Dec 4, 2018

We need more test coverage for same table negation case, but it seems to work right now just needs verificaton

@kirrg001 kirrg001 self-assigned this Dec 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants