(opts)
| 446 | |
| 447 | |
| 448 | def parse_collection_options(opts): |
| 449 | if "readPreference" in opts: |
| 450 | opts["read_preference"] = parse_read_preference(opts.pop("readPreference")) |
| 451 | |
| 452 | if "writeConcern" in opts: |
| 453 | opts["write_concern"] = WriteConcern(**dict(opts.pop("writeConcern"))) |
| 454 | |
| 455 | if "readConcern" in opts: |
| 456 | opts["read_concern"] = ReadConcern(**dict(opts.pop("readConcern"))) |
| 457 | |
| 458 | if "timeoutMS" in opts: |
| 459 | opts["timeout"] = int(opts.pop("timeoutMS")) / 1000.0 |
| 460 | return opts |
| 461 | |
| 462 | |
| 463 | @contextlib.contextmanager |
no test coverage detected