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

Explain how to fetch nested collection in EntriesQuery #580

Open
bidoubiwa opened this issue Nov 15, 2022 · 4 comments
Open

Explain how to fetch nested collection in EntriesQuery #580

bidoubiwa opened this issue Nov 15, 2022 · 4 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@bidoubiwa
Copy link
Contributor

Using the entriesQuery parameter, you can add a field named populate that helps you fetch nested collection.

See example

module.exports = {
meilisearch: {
config: {
restaurant: {
entriesQuery: {
populate: ['repeatableComponent.categories', 'categories'],
},
},
},
},
}

See doc in Strapi on how populate works.

It would be nice to add some information in the Readme about populate for users not aware that they need to use populate to fetch nested collections (see #506)

@simon-online
Copy link

Does this entriesQuery populate config also work for dynamic zone components in Strapi so you can search across text content inside dynamic zone components?

@bidoubiwa
Copy link
Contributor Author

Hey @simon-online, I'm sorry but you'll need to ask that to strapi. I'm just passing the configuration directly to strapi's ORM without any changes

@simon-online
Copy link

Ok, so as long as the configuration is valid then Strapi will return the content for a dynamic zone.

However it sounds like strapi-plugin-meilisearch currently hasn't been tested with dynamic zone components so there could be an issue or it may just work if the data is in the same format as a repeatable component.

@bidoubiwa
Copy link
Contributor Author

Hey @simon-online, yes, it was not tested, unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants