File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2389,7 +2389,7 @@ export class Collection<
23892389 ) : Promise < RunCommandCursor > {
23902390 this . _emitCollectionApiCall ( 'checkMetadataConsistency' , { options } ) ;
23912391
2392- return this . _database . _runCursorCommand ( {
2392+ return await this . _database . _runCursorCommand ( {
23932393 checkMetadataConsistency : this . _name ,
23942394 } ) ;
23952395 }
@@ -2531,7 +2531,11 @@ export class Collection<
25312531
25322532 async _getSampleDocs ( ) : Promise < Document [ ] > {
25332533 this . _cachedSampleDocs = await (
2534- await this . aggregate ( [ { $sample : { size : 10 } } ] )
2534+ await this . aggregate ( [ { $sample : { size : 10 } } ] , {
2535+ allowDiskUse : true ,
2536+ maxTimeMS : 1000 ,
2537+ readPreference : 'secondaryPreferred' ,
2538+ } )
25352539 ) . toArray ( ) ;
25362540 return this . _cachedSampleDocs ;
25372541 }
You can’t perform that action at this time.
0 commit comments