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

Added support for one $and conjunction case and one negation case (relations) #16

Merged
merged 7 commits into from
Nov 16, 2018

Conversation

kirrg001
Copy link
Contributor

@kirrg001 kirrg001 commented Nov 15, 2018

refs #5

  • $and: [tags.slug:en, tags.slug:de]
  • $and: [{'tags.slug': 'animal'},{'tags.slug': {$nin: ['classic']}}]

refs #7

  • tags.slug:-animal

And some more 👻

@kirrg001 kirrg001 changed the title [WIP] ✨ Added support for 1 and conjunction case ✨ Added support for 1 and conjunction case Nov 15, 2018
@kirrg001 kirrg001 changed the title ✨ Added support for 1 and conjunction case [WIP] ✨ Added support for 1 and conjunction case Nov 15, 2018
@kirrg001 kirrg001 force-pushed the and-conj branch 2 times, most recently from c0d3209 to 4a67b37 Compare November 15, 2018 16:47
@kirrg001 kirrg001 changed the title [WIP] ✨ Added support for 1 and conjunction case [WIP] Added support for one $and conjunction case and one negation case (relations) Nov 15, 2018
@kirrg001
Copy link
Contributor Author

kirrg001 commented Nov 15, 2018

@gargol I tried to refactor the logic, but it's tricky, because there are so many cases.
I also tried to use having count(*), but that only works for one specific use case and i need a different architecture for it (preparation for the where statements).

I'd suggest to just leave this as is and add more use cases.

@kirrg001 kirrg001 changed the title [WIP] Added support for one $and conjunction case and one negation case (relations) Added support for one $and conjunction case and one negation case (relations) Nov 15, 2018
@kirrg001
Copy link
Contributor Author

@gargol Ready for review. If you merge, please merge all commits into master.

refs TryGhost#5

- $and: [{'tags.slug': 'animal'},{'tags.slug': {$nin: ['classic']}}]
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 kirrg001 merged commit 65f4edb into TryGhost:master Nov 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants