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,
)
| 269 | |
| 270 | |
| 271 | def _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 |