-
Type: Improvement
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: 1.9.0
-
Component/s: Shell
-
None
Working with GUIDs in the mongo shell is painful. We need a better way to enter them. One suggestion, a factory method on BinData:
> BinData.fromGuid("b4ebe978-bf69-489c-9d3e-bc6839d6de25")
BinData(3,"tOvpeL9pSJydPrxoOdbeJQ==")
>
Or some other usable alternative. The shell should also use the same notation on output so that it is more readable.
One final problem: all existing C# drivers have been writing GUIDs in a binary representation where the first three fields of the GUID are little endian (because that's what Guid.ToByteArray happens to return), whereas all other drivers are using the more sensible big endian representation. So depending on which driver stored the GUID the string representation would be different. This is a really difficult problem to solve without backward compatibility problems. The shell is affected because it needs to know what byte order to use when converting the string representation of a GUID to an instance of BinData.
- duplicates
-
SERVER-29154 Have mongo shell display and accept UUID as such instead of BinData(4, ...)
- Closed
- is depended on by
-
CSHARP-1708 Add Support For GUID in ToString representation of a cursor
- Closed
- is duplicated by
-
SERVER-1201 shell support for UUID (binary subtype 3)
- Closed
- is related to
-
SERVER-43411 add base64 and UUID conversion functions or add BinData $convert
- Closed
-
SERVER-3168 add some convenient methods for BinData and UUID
- Closed
- links to