-
-
Save edgarcosta/96d33b7ee79b4b64ab1123d50c05da6b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python 2.7.10 (default, Apr 25 2016, 18:50:49) | |
[GCC 4.8.4] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> from pymongo import * | |
>>> from time import sleep | |
>>> print version | |
2.8 | |
>>> C = MongoClient("m0.lmfdb.xyz", replicaSet = "lmfdb0", read_preference = ReadPreference.SECONDARY) | |
>>> sleep(1) | |
>>> print C.host | |
warwick.lmfdb.xyz | |
>>> print C.is_primary | |
True | |
>>> print C.read_preference | |
2 | |
>>> print C.secondary_acceptable_latency_ms | |
15 | |
>>> sleep(30) | |
>>> print C.host | |
warwick.lmfdb.xyz | |
>>> print C.is_primary | |
True | |
>>> print C.read_preference | |
2 | |
>>> print C.secondary_acceptable_latency_ms | |
15 | |
>>> print C.primary | |
Database(MongoClient([u'm1.lmfdb.xyz:27017', u'warwick.lmfdb.xyz:37010', u'm0.lmfdb.xyz:27017']), u'primary') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment