I have docs for contacts which have an array of docs called emails. The blow gets the the farm who has an email which matches my clause. But it does not only return the email element with the address match but all emails for the farm that has a doc with the matching email.
So how can i limit the return to only the email doc in array which also matches the e.address ?
select c.emails from Contacts c where c._type= "farm" AND ANY e IN c.emails SATISFIES e.address = 'email@example.com' END;