I am attempting to insert an object into mongoDB using ruby and retrieve it using c# and the NoRM driver.
All seemed to be progressing well until I wanted to use a Guid within my c# object.
I used the following code to set a UUID in ruby before inserting it into mongo (as suggested by this blog post http://blog.mikeobrien.net/2010/08/working-with-guids-in-mongodb-with-ruby.html):
BSON::Binary.new("d7b73eed91c549bfaa9ea3973aa97c7b", BSON::Binary::SUBTYPE_UUID)
When retrieving this object in c# the exception "Byte array for GUID must be exactly 16 bytes long." was thrown.
Using the administrative shell I inspected the contents of the object. The guid property had been set to
BinData(3,"ZDdiNzNlZWQ5MWM1NDliZmFhOWVhMzk3M2FhOTdjN2I=")
However if I inserted the same Guid using c# the guid property was set to
BinData(3,"7T6318WRv0mqnqOXOql8ew==")
Any ideas what I'm doing wrong?