I tried putting categories.plates.variants in the find and findOne methods and it didn’t work. Am I missing something? I know there’s a lot of nested stuff in it and I’m open to suggestions.
I’ve added the following code to the controller of “products”. The code will populate the relation field “category” and the deep nested relation “gender” which is attached to “category”. Should work with Mongoose as a database.
I’ve tried something similar to this, but it did not work. In my case, I am trying to populate a relation inside a component that is being used in a dynamic zone.
For reference, here’s my schema and the code I’ve tried:
The query above will throw this mongoose error: MissingSchemaError: Schema hasn't been registered for model "home".
As a workaround, I am just making a second query with the IDs that are being returned and it works fine. But, it would be awesome to find a solve to this. Thanks!