Is there any way to query the couchDB records by nested properties of an array? #couchdb #fabric-chaincode

Marek Malik <info@...>

Hi there, 

I'm was trying to find out if this is possible on the SO and reading the CouchDB documentation, but could not find anything that would work on the Fauxton web client to test it.

I have a data structure that aggregates into an array of items. There is this one use case where I need to query for all objects that have any of its items containing a given value. I was hoping to make the data structure not flat because of the quickness of retrieving the data by the key which is the main use case. But I need to have the second use case, and I don't know how many items there would be so this feature could eventually end up running long.
Is there any way I can utilize CouchDB to work in my favor or I need to flatten the data structure?

Thanks for any help