Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is was a confusing API choice that we regret in PyMongo 2.x. We will merge all the client classes into MongoClient in PyMongo 3, in April 2015:</p> <p><a href="http://emptysqua.re/blog/good-idea-at-the-time-pymongo-mongoreplicasetclient/" rel="nofollow">http://emptysqua.re/blog/good-idea-at-the-time-pymongo-mongoreplicasetclient/</a></p> <p>Meanwhile:</p> <ol> <li>Use MongoReplicaSetClient when you plan to connect to a whole replica set. MongoClient only connects to <strong>one</strong> member.</li> <li>A single MongoReplicaSetClient can be used to perform primary or secondary reads, as well as more sophisticated decision-making with read preferences, see <a href="http://emptysqua.re/blog/reading-from-mongodb-replica-sets-with-pymongo/" rel="nofollow">my blog post on the subject</a>. A MongoClient will connect to <strong>one</strong> member of the replica set (the primary) and always read from it, unless you make a direct connection to a secondary using MongoClient, in which case it will always read from that secondary.</li> <li>MongoReplicaSetClient monitors the set's health with a background thread that periodically checks on all the members. The client tracks whether members are up, it tracks their ping times, and it notices when a member is added. This will reduce the number of exceptions you see on a flaky network or when the replica set's configuration changes, and it allows the client to correctly implement read preferences.</li> <li>A MongoReplicaSetClient does in fact connect to all members, whereas a MongoClient only connects to <strong>one</strong> member. MongoReplicaSetClient tries to connect to each member listed in the connection string; as soon as it connects to one it asks that member for a list of all other members. From this point forward it ignores your connection string and uses the list it got from the member it connected to.</li> </ol>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload