N1QL for array elements

It needs both places. Projection expression starts with ARRAY and ends with END. Where caluse expression starts with ANY and end with END. You can’t use where clause derived expression in projection vice versa.

Whenever you reference data it comes from source i.e. bucket. If you don’t want that way use UNNEST.

The index will not qualify you check this out https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/indexing-arrays.html.

If you indexed {d.stockSymbol, d.businessDate} then UNNEST where clause or ANY … SATISFIES clause must have
{d.stockSymbol, d.businessDate} = {
“businessDate”: “2020-02-11”,
“buyerName”: “Lalan Securities Private Limited”}

This type of comparison is very hard always not possible. So index one search value and do indexscan and then apply post Fetch other predicates.