@@ -63,6 +63,8 @@ const kDescription = Symbol('description');
63
63
const kIsMaster = Symbol ( 'ismaster' ) ;
64
64
/** @internal */
65
65
const kAutoEncrypter = Symbol ( 'autoEncrypter' ) ;
66
+ /** @internal */
67
+ const kFullResult = Symbol ( 'fullResult' ) ;
66
68
67
69
/** @internal */
68
70
export interface QueryOptions extends BSONSerializeOptions {
@@ -81,15 +83,15 @@ export interface QueryOptions extends BSONSerializeOptions {
81
83
oplogReplay ?: boolean ;
82
84
}
83
85
84
- /** @public */
86
+ /** @internal */
85
87
export interface CommandOptions extends BSONSerializeOptions {
86
88
command ?: boolean ;
87
89
slaveOk ?: boolean ;
88
90
/** Specify read preference if command supports it */
89
91
readPreference ?: ReadPreferenceLike ;
90
92
raw ?: boolean ;
91
93
monitoring ?: boolean ;
92
- fullResult ?: boolean ;
94
+ [ kFullResult ] ?: boolean ;
93
95
socketTimeoutMS ?: number ;
94
96
/** Session to use for the operation */
95
97
session ?: ClientSession ;
@@ -492,7 +494,7 @@ export class Connection extends TypedEventEmitter<ConnectionEvents> {
492
494
write (
493
495
this ,
494
496
query ,
495
- { fullResult : true , ...pluckBSONSerializeOptions ( options ) } ,
497
+ { [ kFullResult ] : true , ...pluckBSONSerializeOptions ( options ) } ,
496
498
( err , result ) => {
497
499
if ( err || ! result ) return callback ( err , result ) ;
498
500
if ( isExplain && result . documents && result . documents [ 0 ] ) {
@@ -511,7 +513,7 @@ export class Connection extends TypedEventEmitter<ConnectionEvents> {
511
513
options : GetMoreOptions ,
512
514
callback : Callback < Document >
513
515
) : void {
514
- const fullResult = typeof options . fullResult === 'boolean' ? options . fullResult : false ;
516
+ const fullResult = ! ! options [ kFullResult ] ;
515
517
const wireVersion = maxWireVersion ( this ) ;
516
518
if ( ! cursorId ) {
517
519
// TODO(NODE-3483): Replace this with a MongoCommandError
@@ -526,7 +528,7 @@ export class Connection extends TypedEventEmitter<ConnectionEvents> {
526
528
Object . assign ( options , { ...pluckBSONSerializeOptions ( options ) } )
527
529
) ;
528
530
529
- queryOptions . fullResult = true ;
531
+ queryOptions [ kFullResult ] = true ;
530
532
queryOptions . command = true ;
531
533
write ( this , getMoreOp , queryOptions , ( err , response ) => {
532
534
if ( fullResult ) return callback ( err , response ) ;
@@ -591,7 +593,7 @@ export class Connection extends TypedEventEmitter<ConnectionEvents> {
591
593
this . command (
592
594
ns ,
593
595
{ killCursors : ns . collection , cursors : cursorIds } ,
594
- { fullResult : true , ...options } ,
596
+ { [ kFullResult ] : true , ...options } ,
595
597
( err , response ) => {
596
598
if ( err || ! response ) return callback ( err ) ;
597
599
if ( response . cursorNotFound ) {
@@ -774,7 +776,7 @@ function write(
774
776
requestId : command . requestId ,
775
777
cb : callback ,
776
778
session : options . session ,
777
- fullResult : typeof options . fullResult === 'boolean' ? options . fullResult : false ,
779
+ fullResult : ! ! options [ kFullResult ] ,
778
780
noResponse : typeof options . noResponse === 'boolean' ? options . noResponse : false ,
779
781
documentsReturnedIn : options . documentsReturnedIn ,
780
782
command : ! ! options . command ,
0 commit comments