Closed dmadroja closed 7 years ago
The reason is that you have maps inside your Bins, and maps are returned as map[interface{}]interface{}
by the Go client. Go's standard JSON marshaller does not accept that data type.
You have two solutions:
map[string]interface{}
Query/ScanAllObjects
to read the data and then marshal them.I converted my map and now it is working. Thanks :) Small clarification, I am using Query in my above example so anyway I have to marshal the result Binmap which will fail. Isn't it?
QueryObject is different from Query call. It can internally marshal the Bin into Structs.
ohh... I checked the reflect file but overlooked it :( . Got it. Thanks
I am trying to read all the records from the set and map it to struct. I am getting error while I try to marshal the rec.Record.Bins to json value
Below is my code:
The aerospike schema is as below: