From 75a7772cd3f47077142f520bfe3cd4d84666dbc9 Mon Sep 17 00:00:00 2001 From: rtritto Date: Wed, 22 Feb 2023 14:58:32 +0100 Subject: [PATCH] Fix Binary subtype of UUID --- src/scope.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scope.ts b/src/scope.ts index 7c226d3..808de6e 100644 --- a/src/scope.ts +++ b/src/scope.ts @@ -20,7 +20,7 @@ const SCOPE: { [x: string]: Function } = { if (u === undefined) { return new bson.UUID().toBinary(); } - return new bson.Binary(Buffer.from(u.replace(/-/g, ''), 'hex'), 4); + return new bson.Binary(Buffer.from(u.replace(/-/g, ''), 'hex'), bson.Binary.SUBTYPE_UUID); }, Code: function(c: any, s: any) { return new bson.Code(c, s);