Did I find the right examples for you? yes no

All Samples(84)  |  Call(50)  |  Derive(5)  |  Import(29)
Connection to a MongoDB replica set.
    

src/m/e/metrique-HEAD/src/metriqued/metriqued/basemongodb.py   metrique(Download)
import os
try:
    from pymongo import MongoClient, MongoReplicaSetClient
except ImportError:
    raise ImportError("Pymongo 2.6+ required!")
    def _load_mongo_replica_client(self, **kwargs):
            logger.debug('Loading new MongoReplicaSetClient connection')
            read_preference = READ_PREFERENCE[self.read_preference]
            self._proxy = MongoReplicaSetClient(
                self.host, self.port, tz_aware=self.tz_aware,

src/m/e/metriqued-0.2.7-1a/metriqued/basemongodb.py   metriqued(Download)
import os
try:
    from pymongo import MongoClient, MongoReplicaSetClient
except ImportError:
    raise ImportError("Pymongo 2.6+ required!")
    def _load_mongo_replica_client(self, **kwargs):
            logger.debug('Loading new MongoReplicaSetClient connection')
            read_preference = READ_PREFERENCE[self.read_preference]
            self._proxy = MongoReplicaSetClient(
                self.host, self.port, tz_aware=self.tz_aware,

src/m/e/metrique-0.3.0-6a/metrique/mongodb_api.py   metrique(Download)
 
try:
    from pymongo import MongoClient, MongoReplicaSetClient
    from pymongo.read_preferences import ReadPreference
    from pymongo.errors import OperationFailure
        read_preference = READ_PREFERENCE[pref]
        _proxy = MongoReplicaSetClient(
            self.mongodb_config.get('host'), self.mongodb_config.get('port'),
            tz_aware=self.mongodb_config.get('tz_aware'),
            w=self.mongodb_config.get('write_concern'),

src/f/o/foofind-web-HEAD/foofind/services/db/filesstore.py   foofind-web(Download)
        self.replica_set_tag_sets = app.config.get("DATA_SOURCE_SERVER_RS_TAG_SETS",[{}])
 
        self.server_conn = pymongo.MongoReplicaSetClient(hosts_or_uri=app.config["DATA_SOURCE_SERVER"], replicaSet=self.replica_set, max_pool_size=self.max_pool_size, socketTimeoutMS=self.get_files_timeout*1000, read_preference=pymongo.read_preferences.ReadPreference.SECONDARY_PREFERRED, secondary_acceptable_latency_ms=self.secondary_acceptable_latency_ms, tag_sets = self.replica_set_tag_sets)
 
        global profiler
            sid = str(server_id)
            if not sid in self.servers_conn:
                self.servers_conn[sid] = self.server_conn if self.replica_set==server["rs"] else pymongo.MongoReplicaSetClient(hosts_or_uri="%s:%d,%s:%d"%(server["ip"], int(server["p"]), server["rip"], int(server["rp"])), replicaSet=server["rs"], max_pool_size=self.max_pool_size, socketTimeoutMS=self.get_files_timeout*1000, read_preference=pymongo.read_preferences.ReadPreference.SECONDARY_PREFERRED, secondary_acceptable_latency_ms=self.secondary_acceptable_latency_ms)
            if self.current_server < server_id:
                self.current_server = server_id

src/f/o/foofind-web-HEAD/foofind/services/db/configstore.py   foofind-web(Download)
        if app.config["DATA_SOURCE_CONFIG"]:
            if "DATA_SOURCE_CONFIG_RS" in app.config:
                self.config_conn = pymongo.MongoReplicaSetClient(app.config["DATA_SOURCE_CONFIG"],
                                                                max_pool_size=app.config["DATA_SOURCE_MAX_POOL_SIZE"],
                                                                replicaSet = app.config["DATA_SOURCE_CONFIG_RS"],

src/f/o/foofind-web-HEAD/foofind/services/db/usersstore.py   foofind-web(Download)
        if app.config["DATA_SOURCE_USER"]:
            if "DATA_SOURCE_USER_RS" in app.config:
                self.user_conn = pymongo.MongoReplicaSetClient(app.config["DATA_SOURCE_USER"],
                                                                max_pool_size=app.config["DATA_SOURCE_MAX_POOL_SIZE"],
                                                                replicaSet = app.config["DATA_SOURCE_USER_RS"],

src/f/o/foofind-web-HEAD/foofind/services/db/pagesstore.py   foofind-web(Download)
        if app.config["DATA_SOURCE_PAGES"]:
            if "DATA_SOURCE_PAGES_RS" in app.config:
                self.pages_conn = pymongo.MongoReplicaSetClient(app.config["DATA_SOURCE_PAGES"],
                                                                max_pool_size=app.config["DATA_SOURCE_MAX_POOL_SIZE"],
                                                                replicaSet = app.config["DATA_SOURCE_PAGES_RS"],

src/f/o/foofind-web-HEAD/foofind/services/db/entitiesstore.py   foofind-web(Download)
            try:
                if "DATA_SOURCE_ENTITIES_RS" in app.config:
                    self.entities_conn = pymongo.MongoReplicaSetClient(app.config["DATA_SOURCE_ENTITIES"],
                                                                    max_pool_size=app.config["DATA_SOURCE_MAX_POOL_SIZE"],
                                                                    replicaSet = app.config["DATA_SOURCE_ENTITIES_RS"],

src/k/e/keystone-HEAD/keystone/common/cache/backends/mongo.py   keystone(Download)
        if self.use_replica:
            connection = pymongo.MongoReplicaSetClient(
                host=self.hosts, replicaSet=self.replicaset_name,
                max_pool_size=self.max_pool_size, **self.conn_kwargs)
        else:  # used for standalone node or mongos in sharded setup

src/i/m/imsto-HEAD/imsto/store.py   imsto(Download)
from hashlib import md5
from numbers import Integral
from pymongo import ASCENDING, DESCENDING, MongoClient, MongoReplicaSetClient, ReadPreference
from _config import Config
from _base import base_convert
def get_mongo_db(host_or_uri, db_name, replica_set = None):
	if replica_set:
		c = MongoReplicaSetClient(host_or_uri, replicaSet=replica_set,read_preference=ReadPreference.NEAREST)
	else:
		c = MongoClient(host_or_uri,read_preference=ReadPreference.NEAREST)

  1 | 2 | 3 | 4  Next