Format output to be able to use In clause


When using a query to get a list of emails for a user to be used then in a in query I come across the following issue. My query returns something like this

[{ “address” : “”},{“address” : “”}] or I can change it to

{ “address” : [“”,””]}

How can I use this result in an in clause, which comes from a query of emails in a array of emails in user doc.

I want to now query all emails where the email in [address of the subquery]


Subquery must use RAW and must project single field.

FROM default AS d
WHERE d.emialid  IN  (SELECT RAW d1.eaddress FROM default AS d1 WHERE .....);