I have a simple relationship as follows:
courses
has many chapters
.chapters
has many lessons
.chapters
belongs to only one courses
.lessons
belongs to only one chapters
.users
can access courses
, and the permission is inherited by children lessons
.What do you think is a good way to implement this in Payload? How about even more nested relationships? Technically, I can create 3 collections respectively, but that might not be the cleanest way for data entry due to applying repetitive changes (roles, relationship pointers) at different locations.
This seems achievable via Payload Nested Docs Plugin, but I'm not sure if it is the right solution as I don't require a nested URL slug.
It appears the Array collection is applicable in this use case. The good thing is that it can be nested so I can consolidate content under one courses
. Probably there are performance and query implications using this way, but I will see how it goes.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.