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

Method estimatedDocumentCount

src/collection.ts:796–801  ·  view source on GitHub ↗

* Gets an estimate of the count of documents in a collection using collection metadata. * This will always run a count command on all server versions. * * due to an oversight in versions 5.0.0-5.0.8 of MongoDB, the count command, * which estimatedDocumentCount uses in its implementation,

(options?: EstimatedDocumentCountOptions)

Source from the content-addressed store, hash-verified

794 * @param options - Optional settings for the command
795 */
796 async estimatedDocumentCount(options?: EstimatedDocumentCountOptions): Promise<number> {
797 return await executeOperation(
798 this.client,
799 new EstimatedDocumentCountOperation(this as TODO_NODE_3286, resolveOptions(this, options))
800 );
801 }
802
803 /**
804 * Gets the number of documents matching the filter.

Callers 8

operations.tsFile · 0.80
x509_auth.test.tsFile · 0.80
collection.test.tsFile · 0.80
collations.test.jsFile · 0.80

Calls 2

executeOperationFunction · 0.90
resolveOptionsFunction · 0.90

Tested by

no test coverage detected