File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
import { type Document , Long } from '../bson' ;
2
2
import { MongoInvalidArgumentError , MongoTailableCursorError } from '../error' ;
3
- import type { ExplainVerbosityLike } from '../explain' ;
3
+ import { Explain , type ExplainVerbosityLike } from '../explain' ;
4
4
import type { MongoClient } from '../mongo_client' ;
5
5
import type { CollationOptions } from '../operations/command' ;
6
6
import { CountOperation , type CountOptions } from '../operations/count' ;
@@ -77,7 +77,9 @@ export class FindCursor<TSchema = any> extends AbstractCursor<TSchema> {
77
77
78
78
const response = await executeOperation ( this . client , findOperation ) ;
79
79
80
- this [ kNumReturned ] = response . cursor . firstBatch . length ;
80
+ if ( ! Explain . fromOptions ( this [ kBuiltOptions ] ) ) {
81
+ this [ kNumReturned ] = response . cursor . firstBatch . length ;
82
+ }
81
83
82
84
// TODO: NODE-2882
83
85
return { server : findOperation . server , session, response } ;
You can’t perform that action at this time.
0 commit comments