How to query JSON data in chain codes stored in couchDB #fabric-chaincode


pham.qtpham@...
 

Hi All,

In my chaincodes, which stored in couchDB,  I have a data structure like this:

const order = {
   
orderNumber,
   orderItems: JSON.stringify(OrderItemObj),

   orderStatus
}

Where OrderItemObj is , e.g.

OrderItemObj = [
   {"itemNumber": 1, "itemName" : "Apple", "itemQty: 100},
   {"itemNumber": 2, "itemName" : "Pear", "itemQty: 200}
]
 

How can I use rich query feature of couchDB to query all orders having , e.g. itemNumber = 1 ?

Trung