Why querying on the 2nd level not working?

default discord avatar
johnmadrigal_
7 months ago
3

I use this query to get a collection record, why is it not working?



{


"location.locationGroup.title": {


equals: searchParams.locationGroup,


}


}

  • default discord avatar
    Jarrod
    7 months ago

    If you console log searchParams.locationGroup, what do you get?



    Can you share the config for this location field on the collection you are querying

  • default discord avatar
    johnmadrigal_
    7 months ago

    I double check the searchParams.locationGroup, its showing the right value.



    Project Collection:


    https://pastebin.com/dxc0cpzc

    Location Collection:


    https://pastebin.com/bkiJDdkm

    Location Group Collection:


    https://pastebin.com/5KHmsJWn

    I also have another query that looking for location.title, it works fine, I notice that only when I try to go 1 level deep, it doesn't work.

  • discord user avatar
    jesschow
    Payload Team
    6 months ago

    @johnmadrigal_

    https://github.com/payloadcms/payload/discussions/761

    I believe nested queries are not supported but this is on our roadmap to implement in the future

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.