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<
2389
2389
) : Promise < RunCommandCursor > {
2390
2390
this . _emitCollectionApiCall ( 'checkMetadataConsistency' , { options } ) ;
2391
2391
2392
- return this . _database . _runCursorCommand ( {
2392
+ return await this . _database . _runCursorCommand ( {
2393
2393
checkMetadataConsistency : this . _name ,
2394
2394
} ) ;
2395
2395
}
@@ -2531,7 +2531,11 @@ export class Collection<
2531
2531
2532
2532
async _getSampleDocs ( ) : Promise < Document [ ] > {
2533
2533
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
+ } )
2535
2539
) . toArray ( ) ;
2536
2540
return this . _cachedSampleDocs ;
2537
2541
}
You can’t perform that action at this time.
0 commit comments