Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-3153

The mongo shell needs better support for displaying and entering GUIDs/UUIDs

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor - P4
    • Resolution: Unresolved
    • Affects Version/s: 1.9.0
    • Fix Version/s: Backlog
    • Component/s: Shell
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                16 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated: