[SERVER-12835] UUID() shell method should use binary subtype 4 Created: 21/Feb/14  Updated: 29/Jan/18  Resolved: 10/Nov/17

Status: Closed
Project: Core Server
Component/s: JavaScript, Shell
Affects Version/s: 2.6.0-rc0
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Duplicate Votes: 0
Labels: uuid
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-29154 Have mongo shell display and accept U... Closed
Related
is related to DOCS-1543 UUID BinData subtype Closed
Backwards Compatibility: Minor Change
Participants:

 Description   

Currently, the UUID() method creates binary data with subtype 3, which is deprecated.

> UUID('0123456789abcdeffedcba9876543210')
BinData(3,"ASNFZ4mrze/+3LqYdlQyEA==")
>

Subtype 4 should be used, and we should ensure that the generated UUID is compliant with RFC 4122. See DOCS-1543 and related driver tickets (e.g. Java, C#, and Python) for additional information.



 Comments   
Comment by Geert Bosch [ 13/Nov/17 ]

The Mongo shell UUID() method now uses binary subtype 4 by default. It will generate RFC4122 version 4 (random) UUIDs and output them as:

> UUID()
UUID("18fa270f-961d-4688-b4b8-bc226f54ea37")
> BinData(4,"GPonD5YdRoi0uLwib1TqNw==")
UUID("18fa270f-961d-4688-b4b8-bc226f54ea37")
> UUID("18fa270f-961d-4688-b4b8-bc226f54ea37")
UUID("18fa270f-961d-4688-b4b8-bc226f54ea37")

Comment by Jeremy Mikola [ 13/Nov/17 ]

geert@mongodb.com: What issue is this duplicating? DOCS-1543 was resolved as "Won't Fix", so I'd imagine this should also be resolved as "Won't Fix" if you intend to continue using deprecated subtype 3 in the shell.

Generated at Thu Feb 08 03:29:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.