I was using dynamodbattribute.ConvertToMap(item) function to save items in dynamodb. But later ConvertToMap deprecated and I started to use dynamodbattribute.MarshalMap(item) function. But I can not get items from db which are saved with ConvertToMap function.
dynamodbattribute.ConvertToMap(item) saved items in dynamodb like this:
dynamodbattribute.Marshal(item) saved items in dynamodb like this:
I'm getting items from db like this:
err := d.table.Get("id", appId).Order(false).Limit(1).One(&item)
This function works with items which saved with dynamodbattribute.MarshalMap(*item) function. But old items which are saved with dynamodbattribute.ConvertToMap(*item) function are not readable with
err := d.table.Get("id", appId).Order(false).Limit(1).One(&item)
It gives this error:dynamo: cannot unmarshal map data into slice
How can I read old items with same function ? I'm using aws sdk: github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute