MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / _count_cmd

Method _count_cmd

pymongo/asynchronous/collection.py:1987–2005  ·  view source on GitHub ↗

Internal count command helper.

(
        self,
        session: Optional[AsyncClientSession],
        conn: AsyncConnection,
        read_preference: Optional[_ServerMode],
        cmd: dict[str, Any],
        collation: Optional[Collation],
    )

Source from the content-addressed store, hash-verified

1985 return AsyncRawBatchCursor(self, *args, **kwargs)
1986
1987 async def _count_cmd(
1988 self,
1989 session: Optional[AsyncClientSession],
1990 conn: AsyncConnection,
1991 read_preference: Optional[_ServerMode],
1992 cmd: dict[str, Any],
1993 collation: Optional[Collation],
1994 ) -> int:
1995 """Internal count command helper."""
1996 res = await self._command(
1997 conn,
1998 cmd,
1999 read_preference=read_preference,
2000 codec_options=self._write_response_codec_options,
2001 read_concern=self.read_concern,
2002 collation=collation,
2003 session=session,
2004 )
2005 return int(res["n"])
2006
2007 async def _aggregate_one_result(
2008 self,

Callers 1

_cmdMethod · 0.95

Calls 1

_commandMethod · 0.95

Tested by

no test coverage detected