-
-
Notifications
You must be signed in to change notification settings - Fork 665
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
Need ability to query z.array()
fields (e.g. tags) in the latest nuxt-content module (v3.alpha.8)
#2960
Comments
Could you provide a simple reproduction? |
.where('tags', 'LIKE', `%${route.params.tag}%`) |
I believe I've run into the same problem as @humblemodulo - the above use of
and this frontmatter:
I expected to be able to filter posts like so:
But instead it returns nothing. |
Have the same issue as @terrarum and @humblemodulo |
I have updated my reproduction repo above to @nuxt/content v3.1.0. The problem persists, as do the horrors. |
facing a similar issue, as I have a custom slug defined which is now part of the meta object. I can't use the .path() method because I do not want to rely on the file name as route slug. However I haven't found a way to access the slug in the query. Using So using like solves it, but I'd which there would be a cleaner approach in the future Thanks @UphkcRNqmafQWcSSSSSS for the tip |
Discussed in #2955
Originally posted by humblemodulo January 7, 2025
In the previous version of nuxt-content (v2) I would simply query tags like so:
However there is no
contains
in v3, and the logic forIN
seems to require the reverse operation. I've triedLIKE
and that doesn't work either.Definitely need to know the best way to find values in z.array() field types.
As it stands, I'm forced to retrieve all, then run JS
.filter()
on the results. Quite inefficient.The text was updated successfully, but these errors were encountered: