0

As the tittle says I want to create some transactions to make queries. In my case I have Wallet and Customer classes and each of them has a type attribute for knowing what type they are. I want, for example to make a query to get all the wallets so I guess I would have to create a query like TYPE=WALLET. The code I use to query is the following.

String queryStr = "{\"selector\": {\"type\": \"wallet\"}}";
QueryResultsIterator<KeyValue> rows = stub.getQueryResult(queryStr);

The things that I don’t know who to structure the string for querying, of if there is a better way of doing this type of queries. Thanks for your help.

Egoes
  • 23
  • 5
  • Do you want to write the query within the chaincode or a separate external file? – Varun Agarwal Jun 25 '19 at 11:33
  • @VarunAgarwal I am writting it on the Chaincode but I would accept any suggestion if writting it on a separate external file is better or easier. I am new with hyperledger and Schemaless databases. – Egoes Jun 26 '19 at 07:30

0 Answers0