I’m trying to read a record from an Aerospike cluster using the Go client library v5. When using GetObject() I can see a map in the returned bins (although an empty map, which is correct):
Now, when trying to read into a struct with GetObject() I’m getting the error interface conversion: interface {} is []aerospike.MapPair, not map[interface {}]interface {}
This is the struct definition:
type PiiDevice struct {
Id string `as:"id"`
Data map[string]int `as:"sgfq"`
}
It seems that the map you are trying to retrieve is an ordered map. While this isn’t technically a bug, it means that the client does not support converting ordered maps back to structs.
Sorry, I’ll try to fix it ASAP. Although keep in mind that the v5 of the client is not supported anymore and you’ll have to upgrade to at least v6, which itself is only on limited support for a short period of time.