MCPcopy
hub / github.com/mongodb/node-mongodb-native / count

Method count

src/collection.ts:1216–1221  ·  view source on GitHub ↗

* 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 = {})

Source from the content-addressed store, hash-verified

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.

Callers 15

operations.tsFile · 0.45
collations.test.jsFile · 0.45
crud_api.test.tsFile · 0.45
maxTimeMS.test.tsFile · 0.45
finishedFunction · 0.45
testFunction · 0.45

Calls 2

executeOperationFunction · 0.90
resolveOptionsFunction · 0.90

Tested by 2

finishedFunction · 0.36
testFunction · 0.36