Skip to content
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

QUESTION: find() and filtering by relation #421

Open
MathiasOdlund opened this issue Jun 20, 2024 · 0 comments
Open

QUESTION: find() and filtering by relation #421

MathiasOdlund opened this issue Jun 20, 2024 · 0 comments
Labels
question Further information is requested

Comments

@MathiasOdlund
Copy link

MathiasOdlund commented Jun 20, 2024

Hey,
I tried to ask my question over at the Nuxt Discord server without much luck.

I have two collection types that has relations with eachother:

  • Products
    • Name
    • slug
  • Subitems
    • name
    • description
      Each Product can have any number of SubItems. Just like SubItems can belong to any number of Products.
      While querying for SubItems, I was wondering how I could search for SubItems that belongs to a certain product using the product slug to identify the product.

const product = await findOne("products", route.params.id);
const subItems = await find("subItems", { filter: someCodeThatTellsMeHowToFindSubItemsUsingTheProductSlug. });

@MathiasOdlund MathiasOdlund added the question Further information is requested label Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant