I have a collection where each document contains a UUID
stored as Binary
. I deserialize it using gson.fromJson(document.toJson(), Class.class);
, but I get an exception of type JsonSyntaxException
where the UUID
is being deserialized. Is there a quick fix for this problem or do I have to change the way I store my UUID
(Would it be efficient to store it as String
)?
Edit:
I changed the UuidRepresentation to STANDARD
, and it works serializing it to a type 4, but when Document#toJson is called, it is deserialized back into a type 3.. Is it possible to set the UuidRepresentation for Document#toJson too?