I use mongodb with Rest. Every document is composed of a field Id(Guid) and Name (string)
Here’s what’s displayed when I access the webpage :
"_id" : { "$binary" : "Oq4RFClrRUOtIp89AQTGPw==",
"$type" : "03"
"name" : "HelloWorld"
In mongodb, my Guid was transformed into a UUID (say my JMongoBrowser) and is displayed as 46eb229f-b493-5630-b0d7-aa00499fafa0.
But when I access my rest webpage, It’s cutted in two parts (a binary, and a type). So how can I cast it into C# object ?
Thanks
The string is a base-64 encoded string representing the guid’s byte array, but you need to deal with byte UUD encoding, so you can have it back like this:
or like this: