File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
// Javascript helper functions for parsing and displaying UUIDs in the MongoDB shell.
2
- // This is a temporary solution until SERVER-3153 is implemented.
3
2
// To create BinData values corresponding to the various driver encodings use:
4
3
// var s = "{00112233-4455-6677-8899-aabbccddeeff}";
5
4
// var uuid = UUID(s); // new Standard encoding
@@ -136,6 +135,12 @@ BinData.prototype.toHexUUID = function () {
136
135
return 'HexData(' + this . subtype ( ) + ', "' + uuid + '")' ;
137
136
}
138
137
138
+ // for compatibility with the new mongosh shell
139
+ if ( BinData . prototype . base64 === undefined && BinData . prototype . subtype === undefined ) {
140
+ BinData . prototype . base64 = function ( ) { return this . buffer . base64Slice ( ) ; } ;
141
+ BinData . prototype . subtype = function ( ) { return this . sub_type ; } ;
142
+ }
143
+
139
144
function TestUUIDHelperFunctions ( ) {
140
145
var s = "{00112233-4455-6677-8899-aabbccddeeff}" ;
141
146
var uuid = UUID ( s ) ;
You can’t perform that action at this time.
0 commit comments