collection: "events",
depth: 1,
where: {
and: [
{ "timesDates.calendar.venue.slug": { equals: venue } },
{ "timesDates.calendar.featured": { equals: true } },
{ _status: { equals: "published" } }
]
}
})```
Is returning events with timesDates.calendar.featured === false as well as true
It seems to be using them together that is breaking it, just using either "venue.slug" or "featured" works, but breaks when I use both and just returns all the results
The structure is correct so it's not that
#payload.find returning incorrect results
1 messages · Page 1 of 1 (latest)
Help is on the way! To mark it as solved, use the /solve command. In the meantime, here are some existing threads that may help you:
Documentation:
- Transactions - Async Hooks with Transactions
- Select - defaultPopulate collection config property
- Hooks Overview - Root Hooks - afterError
Community-Help:
Hey @acoustic slate
Can you try to consolidate those two where clauses, I think one is overwriting the other
So for example:
where: {
and: [
{
"timesDates.calendar": {
equals: {
venue: venueId,
featured: true
}
}
},
{ _status: { equals: "published" } }
]
}
Now returns nothing 🤔
This is the structure:
a couple fields above at the root like id, name etc
venue param is the slug so it needs to check against that, not the id
where: {
and: [
{
"timesDates.calendar": {
equals: {
"venue.slug": venue,
featured: true
}
}
},
{ _status: { equals: "published" } }
]
}