Searching for array entries in jsonata

Hi,
I have a JSON of the structure:

{
	"data": [
		{
			"id": "1232",
			"tags": [
				"tagA",
				"test",
				"tagB"
			], "more": true
		},
		{
			"id": "2232",
			"tags": [
				"tagD",
				"test",
				"tagB"
			], "more": true
		},
		{
			"id": "3432",
			"tags": [
				"tagA",
				"test",
				"tagG"
			], "more": true
		}		
	]
}

Now I try to get the entry in data that has a specific entry in tags, e.g. tagG.
Expected Output:

		{
			"id": "3432",
			"tags": [
				"tagA",
				"test",
				"tagG"
			],
              "more": true
		}

Unfortunately all my tries to query this in jsonata fail.
all tries e.g. like data[tags="tagG"] or using $contains bring always no or all results.

Can you help me or is this not possible with JSONATA?

Try
payload.data[id="3432"]
Presuming the object is in msg.payload.

strike that miss read the question will be back in a mo

[edit try
payload.data["tagG" in tags]

]

Thanks, I can't understand why I did not find this solution on my own :wink:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.