I have these collections,
Location Group
Location
Post
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.
PLEASE HELP
@johnmadrigal_ can you paste in your configs? You may I can help you write a query for this, which would look something like this
?where[location.group.title][equals]=hello&depth=3
(depth might be your missing piece)
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 "author.photo.alt"? 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.
Thanks for the description! Very helpful. That query
shouldlook like this:
https://cms.payloadcms.com/api/posts?where[author.photo.alt][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.
Okay thanks, but is this working before? or we really don't have feature like this?
This was working before so once we fix the issue we'll also write tests to prevent future regression.
Update: this was fixed with
https://github.com/payloadcms/payload/pull/2199Star
Discord
online
Get help straight from the Payload team with an Enterprise License.