We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1019f5e commit 7e70174Copy full SHA for 7e70174
src/mongo_logger.ts
@@ -486,7 +486,12 @@ export function stringifyWithMaxLen(
486
currentLength += value ? 4 : 5;
487
break;
488
case 'object':
489
- if ('_bsontype' in value) {
+ if (isUint8Array(value)) {
490
+ // '{"$binary":{"base64":"<base64 string>","subType":"XX"}}'
491
+ // This is an estimate based on the fact that the base64 is approximately 1.33x the length of
492
+ // the actual binary sequence https://en.wikipedia.org/wiki/Base64
493
+ currentLength += (22 + value.byteLength + value.byteLength * 0.33 + 18) | 0;
494
+ } else if ('_bsontype' in value) {
495
const v = value as BSONObject;
496
switch (v._bsontype) {
497
case 'Int32':
0 commit comments