Dear community
I'm struggling to build a where clause for local api that querries an array.
I have an array field, containing references that looks like following
{
type: 'array',
name: 'conversationTexts',
label: 'Conversation Texts',
fields: [
{
type: 'relationship',
name: 'text',
label: 'Conversation Text',
relationTo: ConversationTexts.slug,
required: true,
},
],
},
Now I want to query on local api if I have a specific element within the array that fulfils something like this:
conversationTexts: { contains : { text: { equals: idToCheck }}}
But it looks like that query is crap.
So does someone know how a correct document query with a search for a payload array object looks like?
Ok looks like its just a
.
concatenation.
conversationTexts.text: {
"equals": "idToCheck"
}
Which I find strange for an array, but ok if it works.
Star
Discord
online
Get dedicated engineering support directly from the Payload team.