actually i have 2 structure in my chaincode and i stored both structure data in ledger and i want to display data of each structure as their need not display all data at a time i want to set condition on query all state function(APIstub.GetStateByRange(startKey, endKey)) i want to restract some state that does not display when we query all state and i would be display retracted state as their need.
e.g structure1 one state having name ,number,address,qualification attributes
structure2 2nd state having name ,cnic ,number,address ,qualification attributes
i want when we query all states then only states(structure1) that having no CNIC attribute will be display
we used apistub.putprivatedata and apistub.getprivatedata but its not work plzzz tell me where i am wrong
my code is following
KEY=strconv.Itoa(rand.Int())
APIstub.PutState(KEY,carAsBytes) // public record
APIstub.PutPrivateData("3740633141725",KEY,carAsBytes2) private record
return shim.Success(nil)