Created
May 20, 2012 21:39
-
-
Save toomore/2759642 to your computer and use it in GitHub Desktop.
MongoDB Master/Slave pymongo Tutorial
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
from pymongo import Connection | |
from pymongo.master_slave_connection import MasterSlaveConnection | |
Master = Connection() | |
Slaves = [Connection('127.0.0.1', 27018), Connection('127.0.0.1', 27019)] | |
db = MasterSlaveConnection(Master, Slaves).YOUR_dbs | |
print db.collection_names() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment