IBM-Blockchain-Archive / cp-web

A demonstration of a commercial paper trading application on IBM Blockchain.
Apache License 2.0
94 stars 232 forks source link

Mutiple queries to display data sets by using fields other than the ID #76

Open suffiasameera opened 7 years ago

suffiasameera commented 7 years ago

What are the queries we can include to extract a data set(from a table), using a field other than the ID? Is it possible?

Can anyone please help me with this?

masterDev1985 commented 7 years ago

If this question is related to fabric v0.6, then you should look here to see what functions are available for manipulating chaincode: https://github.com/hyperledger/fabric/blob/v0.6/core/chaincode/shim/chaincode.go

Any functions with (stub *ChaincodeStub) will be accessible from your chaincode. I guess you're asking if there is a way to look up a value in chaincode without using a the key that it was stored with? I don't think you'll find what you're looking for, but take a look anyway. Maybe you'll find an alternative.

If you're talking about fabric v1.0, I recommend signing in to the Hyperledger Rocket Chat at https://chat.hyperledger.org/channel/general and asking your question there.