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

Function _gen_get_more_command

pymongo/message.py:271–287  ·  view source on GitHub ↗

Generate a getMore command document.

(
    cursor_id: Optional[int],
    coll: str,
    batch_size: Optional[int],
    max_await_time_ms: Optional[int],
    comment: Optional[Any],
    conn: _AgnosticConnection,
)

Source from the content-addressed store, hash-verified

269
270
271def _gen_get_more_command(
272 cursor_id: Optional[int],
273 coll: str,
274 batch_size: Optional[int],
275 max_await_time_ms: Optional[int],
276 comment: Optional[Any],
277 conn: _AgnosticConnection,
278) -> dict[str, Any]:
279 """Generate a getMore command document."""
280 cmd: dict[str, Any] = {"getMore": cursor_id, "collection": coll}
281 if batch_size:
282 cmd["batchSize"] = batch_size
283 if max_await_time_ms is not None:
284 cmd["maxTimeMS"] = max_await_time_ms
285 if comment is not None and conn.max_wire_version >= 9:
286 cmd["comment"] = comment
287 return cmd
288
289
290_pack_compression_header = struct.Struct("<iiiiiiB").pack

Callers 1

as_commandMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected