@@ -304,6 +304,7 @@ export class Response {
304
304
queryFailure ?: boolean ;
305
305
shardConfigStale ?: boolean ;
306
306
awaitCapable ?: boolean ;
307
+ useBigInt64 : boolean ;
307
308
promoteLongs : boolean ;
308
309
promoteValues : boolean ;
309
310
promoteBuffers : boolean ;
@@ -320,6 +321,7 @@ export class Response {
320
321
this . raw = message ;
321
322
this . data = msgBody ;
322
323
this . opts = opts ?? {
324
+ useBigInt64 : false ,
323
325
promoteLongs : true ,
324
326
promoteValues : true ,
325
327
promoteBuffers : false ,
@@ -334,6 +336,7 @@ export class Response {
334
336
this . fromCompressed = msgHeader . fromCompressed ;
335
337
336
338
// Flag values
339
+ this . useBigInt64 = typeof this . opts . useBigInt64 === 'boolean' ? this . opts . useBigInt64 : false ;
337
340
this . promoteLongs = typeof this . opts . promoteLongs === 'boolean' ? this . opts . promoteLongs : true ;
338
341
this . promoteValues =
339
342
typeof this . opts . promoteValues === 'boolean' ? this . opts . promoteValues : true ;
@@ -354,6 +357,7 @@ export class Response {
354
357
// Allow the return of raw documents instead of parsing
355
358
const raw = options . raw || false ;
356
359
const documentsReturnedIn = options . documentsReturnedIn || null ;
360
+ const useBigInt64 = options . useBigInt64 ?? this . opts . useBigInt64 ;
357
361
const promoteLongs = options . promoteLongs ?? this . opts . promoteLongs ;
358
362
const promoteValues = options . promoteValues ?? this . opts . promoteValues ;
359
363
const promoteBuffers = options . promoteBuffers ?? this . opts . promoteBuffers ;
@@ -362,6 +366,7 @@ export class Response {
362
366
363
367
// Set up the options
364
368
const _options : BSONSerializeOptions = {
369
+ useBigInt64,
365
370
promoteLongs,
366
371
promoteValues,
367
372
promoteBuffers,
@@ -590,6 +595,7 @@ export class BinMsg {
590
595
checksumPresent : boolean ;
591
596
moreToCome : boolean ;
592
597
exhaustAllowed : boolean ;
598
+ useBigInt64 : boolean ;
593
599
promoteLongs : boolean ;
594
600
promoteValues : boolean ;
595
601
promoteBuffers : boolean ;
@@ -607,6 +613,7 @@ export class BinMsg {
607
613
this . raw = message ;
608
614
this . data = msgBody ;
609
615
this . opts = opts ?? {
616
+ useBigInt64 : false ,
610
617
promoteLongs : true ,
611
618
promoteValues : true ,
612
619
promoteBuffers : false ,
@@ -625,6 +632,7 @@ export class BinMsg {
625
632
this . checksumPresent = ( this . responseFlags & OPTS_CHECKSUM_PRESENT ) !== 0 ;
626
633
this . moreToCome = ( this . responseFlags & OPTS_MORE_TO_COME ) !== 0 ;
627
634
this . exhaustAllowed = ( this . responseFlags & OPTS_EXHAUST_ALLOWED ) !== 0 ;
635
+ this . useBigInt64 = typeof this . opts . useBigInt64 === 'boolean' ? this . opts . useBigInt64 : false ;
628
636
this . promoteLongs = typeof this . opts . promoteLongs === 'boolean' ? this . opts . promoteLongs : true ;
629
637
this . promoteValues =
630
638
typeof this . opts . promoteValues === 'boolean' ? this . opts . promoteValues : true ;
@@ -648,6 +656,7 @@ export class BinMsg {
648
656
// Allow the return of raw documents instead of parsing
649
657
const raw = options . raw || false ;
650
658
const documentsReturnedIn = options . documentsReturnedIn || null ;
659
+ const useBigInt64 = options . useBigInt64 ?? this . opts . useBigInt64 ;
651
660
const promoteLongs = options . promoteLongs ?? this . opts . promoteLongs ;
652
661
const promoteValues = options . promoteValues ?? this . opts . promoteValues ;
653
662
const promoteBuffers = options . promoteBuffers ?? this . opts . promoteBuffers ;
@@ -656,6 +665,7 @@ export class BinMsg {
656
665
657
666
// Set up the options
658
667
const bsonOptions : BSONSerializeOptions = {
668
+ useBigInt64,
659
669
promoteLongs,
660
670
promoteValues,
661
671
promoteBuffers,
0 commit comments