(key: Any, value: Any)
| 202 | |
| 203 | |
| 204 | def _validate_index_key_pair(key: Any, value: Any) -> None: |
| 205 | if not isinstance(key, str): |
| 206 | raise TypeError(f"first item in each key pair must be an instance of str, not {type(key)}") |
| 207 | if not isinstance(value, (str, int, abc.Mapping)): |
| 208 | raise TypeError( |
| 209 | "second item in each key pair must be 1, -1, " |
| 210 | "'2d', or another valid MongoDB index specifier." |
| 211 | f", not {type(value)}" |
| 212 | ) |
| 213 | |
| 214 | |
| 215 | def _check_command_response( |