Using N1QL I’d use a collection operator like “SELECT FIRST” for this, but Analytics doesn’t see to have an equivalent.
Let’s say my users have an array of addresses, but I only want to SELECT the active address.
This would get the entire user document, including all addresses:
SELECT * FROM users WHERE user_id = 1;
In N1QL I’d do something like this:
SELECT username,
email,
FIRST a FOR a IN addresses WHEN a.active = true END AS address
WHERE user_id = 1
What’s the Analytics equivalent?
Thanks.