Class: CommonIterator

CommonIterator

CommonIterator allows a chaincode to check whether any more result(s) need to be fetched from an iterator and close it when done.

new CommonIterator(handler, channel_id, txID, response)

constructor Note that the decoded payload will be a protobuf of type fabprotos.protos.QueryResponse
Parameters:
Name Type Description
handler ChaincodeSupportClient client handler
channel_id string channel id
txID string transaction id
response object decoded payload

Methods


<async> close()

close the iterator.
Returns:
A promise that is resolved with the close payload or rejected if there is a problem
Type
promise

<async> next()

Get the next value and return it through a promise.
Returns:
a promise that is fulfilled with an object { value: (next value) }, is fulfilled with an object { done: true } if there is no more value, or is rejected if any error occurs.
Type
promise