post.docs[0].project is a previous resolved query.
const connectedPostsQuery = await payload.find({
collection: 'posts',
where: {
project: {
equals: post.docs[0].project,
},
},
})
is is possible to access nested properties with local API?
Figured it out. it was enough to compare "project" directly to
post.docs[0].project.id
since the type was
string | Project
(thank you TypeScript!)
example for the next person:
const connectedPostsQuery = await payload.find({
collection: 'posts',
where: {
project: {
equals: post.docs[0].project.id,
},
},
})
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.