* An estimated count of matching documents in the db to a filter. * * **NOTE:** This method has been deprecated, since it does not provide an accurate count of the documents * in a collection. To obtain an accurate count of documents in the collection, use {@link Collection#countDocuments|
(filter: Filter<TSchema> = {}, options: CountOptions = {})
| 1214 | * @param options - Optional settings for the command |
| 1215 | */ |
| 1216 | async count(filter: Filter<TSchema> = {}, options: CountOptions = {}): Promise<number> { |
| 1217 | return await executeOperation( |
| 1218 | this.client, |
| 1219 | new CountOperation(this.fullNamespace, filter, resolveOptions(this, options)) |
| 1220 | ); |
| 1221 | } |
| 1222 | |
| 1223 | /** |
| 1224 | * Returns all search indexes for the current collection. |