Interface PickRandomPluginStatics<TDocData, TDoc>
Type parameters
-
TDocData: BasicObject
-
TDoc: Document
Methods
tryPickRandomDocuments
- tryPickRandomDocuments<ProjectedData>(this: Model<TDoc>, docsAmount: number, projection?: Maybe<ProjectionOperand<TDocData>>): Promise<ProjectedData[]>
-
Type parameters
Parameters
-
this: Model<TDoc>
-
docsAmount: number
-
Optional projection: Maybe<ProjectionOperand<TDocData>>
Returns Promise<ProjectedData[]>
Tries to pick random
docsAmount
of unique documents from the database collection.NotEnoughDocumentsError if
docsAmount
is greater than the total amount of documents stored in the database collection.