Like what we’re doing? Star us on GitHub!

Is it possible to query a 3 nested collection?

4 weeks ago

I have these collections,

Location Group



Location Group has a value "title" string.

Location has a value "group" which relates to Location Group and "title" string.

Post has a value "location" which relates to Location.

When I'm trying to use dot notation on REST query on Post using location.locationGroup.title, it's not working, but when I use location.title, its working.


  • jacobsfletch
    Payload Team
    4 weeks ago

    @johnmadrigal_ can you paste in your configs? You may I can help you write a query for this, which would look something like this


    (depth might be your missing piece)

  • johnmadrigal_
    4 weeks ago

    Hello Jacob, thanks for responding. I am using your sample work name "website-cms" and I also found the same issue with your code.

    This is the repo code:

    Can you create a Post record and create a query for ""? Because in my end, even if I puth depth in the query, it still shows nothing.


    I'm suspecting that it is not allowed to query the 2nd nested collection, which in your code, the photo inside author which is under post.

    That is the exact issue i'm facing in my own payloadcms app.

  • jacobsfletch
    Payload Team
    4 weeks ago

    Thanks for the description! Very helpful. That query


    look like this:[][equals]=Write%20for%20the%20Community%20Blog%20Image

    but it appears to be broken at the moment 😢

    Go ahead and pull an issue in our repo if you'd like. We'll get this patched up.

  • johnmadrigal_
    4 weeks ago

    Okay thanks, but is this working before? or we really don't have feature like this?

  • jacobsfletch
    Payload Team
    4 weeks ago

    This was working before so once we fix the issue we'll also write tests to prevent future regression.

    Update: this was fixed with
Open the post
Continue the discussion in Discord
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More