I have moved over data from another database that stored UUID’s as strings. The struct that I used in my code looked like this:
struct Message { user_id: uuid:Uuid, content: string }
This issue that I’m having is that now I’ve migrated the data to mongo, when trying to read from the collection, I get this error:

called Result::unwrap() on an Err value: Error { kind: BsonDeserialization(DeserializationError {
message: “invalid type: string "018d6b0c-4a48-76e0-8d61-eb7977071904", expected bytes” }), labels: {}, wire_version: None, source: None }

Then when I change the struct field type to `bson::Uuid``, I get this error:

called Result::unwrap() on an Err value: Error { kind: BsonDeserialization(DeserializationError { message: “expected Binary with subtype Uuid, instead got
String” }), labels: {}, wire_version: None, source: None }

So I think I either have to somehow deal with the deserialization from string to binary in the code or convert all the UUIDs in the db into binary.