Skip to content
Discussion options

You must be logged in to vote

From a quick look, I don't think you can make the rating relationship inside profile populate recursively in the way you're expecting.

Instead, you want to:

  • Populate profile.rating by setting rating: true inside the profile populate object.
  • Then separately populate rating.content via the top-level populate.

What I think happens now:

  • Populate profile.rating is set with an invalid value and is skipped
  • Populate rating is not set and also fully returned

Try something like this:

const res = await payload.find({
  collection: 'users',
  where: { email: { equals: '[email protected]' } },
  select: { profile: true },
  populate: {
    profile: {
      rating: true
    },
    rating: {
       c…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shoodoow
Comment options

Answer selected by shoodoow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants