![]() If you use RoboMongo I showed you above how to show the Guid correctly,- and if you use MongoVue then this setting might be of interest for you. Of course, unless you are good at converting in your head (hah!) that string might not be very helpful. We first thought that something was a bit wack with the conversion, as the result wasn’t right in RoboMongo, - but turns out we had forgotten to enable Legacy UUID Encoding. Why do we need to know that? Because, some GUI tools for Mongo, such as RoboMongo support some of the subtypes. The subtypes are explained in the bson specification. Notice the ‘3’ ? This tells us the subtype, and 3 stands for UUID (old). New BinData(3, “+e280Lr9rEiIFsWKNbrzFQ=”) Net Guids but are not, and in MongoVue just the bindata value) Turns out that you need to enable the conversion in both MongoVue and RoboMongo- otherwise you will be presented with inaccurate data (in RoboMongo something that looks like. For some reason we encountered all of them at work as we hadn’t configured our environment tools correctly. Robin also has some scripts, check them out.īut, that might get tedious, so let’s have a look at a few more options. $Guid = new-object -TypeName System.Guid -ArgumentList (,::FromBase64String($uuid)) #with this you wont need to validate using an IF :) Thank you Damirofor cleaning up my lazy script :)) $uuid = new-object -TypeName System.Guid -ArgumentList (,::FromBase64String($uuid)) Net Guid, and you are not using a GUI tool you could simply use this little PowerShell function I wrote: If you just quickly want to convert that to a. “CustomerEnquiryId” : new BinData(3, “+e280Lr9rEiIFsWKNbrzFQ=”) Here is an example of BinData from a document when we retrieved with MongoVue #Note: Guid (C#) is just Microsofts implementation of UUID (Universally Unique Identifier)- and is basically the same. The id’s where Guids stored as bindata (binary data). While double checking some new features we have been working on we had to track some documents and make sure they update correctly when we send and receive messages.
0 Comments
Leave a Reply. |