Reading document written with Append


#1

I’m trying to read a document that’s written with Append. There’s no transcoding done on the write, but it looks like transcoding is being applied when I try to do a Get on the document. If my document isn’t a valid JSON string, this throws an error.

Is there a better way to retrieve a document that’s been written with Append?


#2

Hey @adamf,

It seems that the original document was written as being JSON, but then append is not able to overwrite this flag to indicate that you are corrupting the JSON. Perhaps a custom transcoder might be in order, another option would be to write the original document as binary (by passing a []byte to the mutation method).

P.S. I am going to look into solutions for the append problem, as using a custom transcoder is not particularly friendly.

Cheers, Brett


#3

Thanks @brett19 - I’ve corrected the original write to store as binary, and that seems to be working.

A related append question - what’s the reason that append uses string instead of []byte for the appended content?