Skip to content

Commit 6fd7a74

Browse files
fix: Use legacy count operation
1 parent 323bb8d commit 6fd7a74

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/collection.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import type {
2121
import type { AggregateOptions } from './operations/aggregate';
2222
import { BulkWriteOperation } from './operations/bulk_write';
2323
import type { IndexInformationOptions } from './operations/common_functions';
24-
import type { CountOptions } from './operations/count';
24+
import { CountOperation, CountOptions } from './operations/count';
2525
import { CountDocumentsOperation, CountDocumentsOptions } from './operations/count_documents';
2626
import {
2727
DeleteManyOperation,
@@ -1637,7 +1637,11 @@ export class Collection<TSchema extends Document = Document> {
16371637
filter ??= {};
16381638
return executeOperation(
16391639
getTopology(this),
1640-
new CountDocumentsOperation(this as TODO_NODE_3286, filter, resolveOptions(this, options)),
1640+
new CountOperation(
1641+
MongoDBNamespace.fromString(this.namespace),
1642+
filter,
1643+
resolveOptions(this, options)
1644+
),
16411645
callback
16421646
);
16431647
}

0 commit comments

Comments
 (0)