Skip to content

Commit 21a7b9f

Browse files
committed
estimated_document_count doesn't take session as a kwarg
1 parent 0c58a62 commit 21a7b9f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

mongoengine/pymongo_support.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ def count_documents(
4343
if not filter and set(kwargs) <= {"max_time_ms"}:
4444
# when no filter is provided, estimated_document_count
4545
# is a lot faster as it uses the collection metadata
46-
return collection.estimated_document_count(
47-
session=connection._get_session(), **kwargs
48-
)
46+
return collection.estimated_document_count(**kwargs)
4947
else:
5048
return collection.count_documents(
5149
filter=filter, session=connection._get_session(), **kwargs

0 commit comments

Comments
 (0)