Failed syncing nested fields with Strapi plugin
See original GitHub issueDiscussed in https://github.com/meilisearch/meilisearch/discussions/2388
<div type='discussions-op-text'>Originally posted by pedrogaudencio May 11, 2022 Hi there!
I’m having an issue when I update a collection-type entry that is nested inside a component/single type/collection. Not sure if this case is already referenced but I couldn’t find it anywhere.
Example:
- Create an
Author
collection type entry -> Meilisearch plugin creates anAuthor
document; - Create an
Article
collection type entry, add anAuthor
collection type field inside the repeatable componentAuthorsList
in theArticle
-> Meilisearch plugin creates anArticle
document with its nested fields; - Update the
Author
entry -> Meilisearch plugin updates theAuthor
document; - Meilisearch plugin does not update the
Author
entry inside the nested fields in theArticle
document.
As a workaround, (in this example) I thought of creating an afterUpdate()
lifecycle hook in the Author triggering the Article document update by calling the Meilisearch plugin controller. Is there a better way to do this? If not, is there an example to call the document update from the Meilisearch plugin?
Using:
Thank you! 😃</div>
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:7 (4 by maintainers)
Top Results From Across the Web
[RESOLVED] Can't get the data from nested components ...
Consider a collection type, Page, which has two fields, a title of type text and sessions of type dynamic zone.
Read more >strapi-plugin-navigation - npm
Start using strapi-plugin-navigation in your project by running `npm ... Flat; Tree (nested); RFR (ready for handling by Redux First Router) ...
Read more >strapi-plugin-permalinks v0.1.7 - npm.io
✨ Features · Manage a chain of slugs to build a unique URL path · Nested relationships for content types · Child relations...
Read more >Configuration
strapi.config.get('server.host', 'defaultValueIfUndefined');. Nested keys are accessible with dot-notation . NOTE. Notice that the filename is used as a ...
Read more >Strapi - working with relationships and how to use Graphql for ...
Relationships, specially nested relationships are always going to come in projects. In this video, I am going to show you how you can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Those suggestions all seem very interesting. Do you know if there’s already something in place?
This was kinda what I was aiming towards with my suggestion of triggering the parent document update by calling the Meilisearch plugin controller. As you say, this is possible using the hooks provided by Strapi and probably the cleanest solution at this point. Although it’s likely that the entry data won’t pass through
transformEntry()
when we bypass the plugin and callmeilisearch.updateEntriesInMeilisearch()
…I think you can have access to
transformEntry
by using the strapi API like this: