Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-593

Can't use UUID() to generate unique random value

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 0.8.0
    • Affects Version/s: 0.7.7
    • Component/s: Shell API
    • None
    • Iteration Vegetable
    • Not Needed

      As per https://docs.mongodb.com/manual/reference/method/UUID/

      Should be able to call UUID() in the shell with no arguments to receive back a random UUID().

      This works in legacy mongo shell

      In mongos this returns an error if no string parameter provided:

      Enterprise > UUID()
      MongoshInvalidInputError: [COMMON-10001] Missing required argument

       This capability is required in aggregation pipelines which need to generate UUIDs (e.g for data masking and later cross referencing of that value).

       

            Assignee:
            anna.henningsen@mongodb.com Anna Henningsen
            Reporter:
            paul.done@mongodb.com Paul Done
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: