Skip to content

Commit 438539e

Browse files
authored
PYTHON-3445 Improve documentation for with_options (#1074)
1 parent 4a5e0f6 commit 438539e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pymongo/database.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ def with_options(
162162
>>> db1.read_preference
163163
Primary()
164164
>>> from pymongo import ReadPreference
165-
>>> db2 = db1.with_options(read_preference=ReadPreference.SECONDARY)
165+
>>> db2 = db1.with_options(read_preference=Secondary([{'node': 'analytics'}]))
166166
>>> db1.read_preference
167167
Primary()
168168
>>> db2.read_preference
169-
Secondary(tag_sets=None)
169+
Secondary(tag_sets=[{'node': 'analytics'}], max_staleness=-1, hedge=None)
170170
171171
:Parameters:
172172
- `codec_options` (optional): An instance of

0 commit comments

Comments
 (0)