Unpack a OP_MSG command response. :param cursor_id: Ignored, for compatibility with _OpReply. :param codec_options: an instance of :class:`~bson.codec_options.CodecOptions` :param user_fields: Response fields that should be decoded using the TypeDecod
(
self,
cursor_id: Optional[int] = None,
codec_options: CodecOptions[Any] = _UNICODE_REPLACE_CODEC_OPTIONS,
user_fields: Optional[Mapping[str, Any]] = None,
legacy_response: bool = False,
)
| 1489 | return [inflated_response] |
| 1490 | |
| 1491 | def unpack_response( |
| 1492 | self, |
| 1493 | cursor_id: Optional[int] = None, |
| 1494 | codec_options: CodecOptions[Any] = _UNICODE_REPLACE_CODEC_OPTIONS, |
| 1495 | user_fields: Optional[Mapping[str, Any]] = None, |
| 1496 | legacy_response: bool = False, |
| 1497 | ) -> list[dict[str, Any]]: |
| 1498 | """Unpack a OP_MSG command response. |
| 1499 | |
| 1500 | :param cursor_id: Ignored, for compatibility with _OpReply. |
| 1501 | :param codec_options: an instance of |
| 1502 | :class:`~bson.codec_options.CodecOptions` |
| 1503 | :param user_fields: Response fields that should be decoded |
| 1504 | using the TypeDecoders from codec_options, passed to |
| 1505 | bson._decode_all_selective. |
| 1506 | """ |
| 1507 | # If _OpMsg is in-use, this cannot be a legacy response. |
| 1508 | assert not legacy_response |
| 1509 | return bson._decode_all_selective(self.payload_document, codec_options, user_fields) |
| 1510 | |
| 1511 | def command_response(self, codec_options: CodecOptions[Any]) -> dict[str, Any]: |
| 1512 | """Unpack a command response.""" |
no outgoing calls
no test coverage detected