-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix - Filter stories by tag name #811
Conversation
@@ -264,7 +264,7 @@ export function createClient( | |||
[`locale`]: localeCode ? { $in: [localeCode] } : undefined, | |||
[`status`]: { $in: [Story.Status.PUBLISHED] }, | |||
[`visibility`]: { $in: [Story.Visibility.PUBLIC] }, | |||
[`tag_names`]: tags?.length ? { $in: [tags] } : undefined, | |||
[`tag.name`]: tags?.length ? { $any: [tags] } : undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between any
and in
in case of search predicate?
Please note that you're passing array in array ([tags]
), I hope it's expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would tags?.length ? { $in: tags } : undefined
also work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This particular filter only supports $any
, $all
and $none
filters, $in is not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But is there any difference between those predicates? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure there is
No description provided.