Did I find the right examples for you? yes no

All Samples(858)  |  Call(554)  |  Derive(5)  |  Import(299)
Connection to MongoDB.
    

src/k/o/kombu-3.0.15/kombu/transport/mongodb.py   kombu(Download)
from pymongo import errors
from anyjson import loads, dumps
from pymongo import MongoClient, uri_parser
 
from kombu.five import Empty
    def _open(self, scheme='mongodb://'):
        hostname, dbname, options = self._parse_uri(scheme=scheme)
 
        mongoconn = MongoClient(
            host=hostname, ssl=options['ssl'],

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_client(self, **kwargs):
        logger.debug('Loading new MongoClient connection')
        self._proxy = MongoClient(self.host, self.port, tz_aware=self.tz_aware,
                                  w=self.write_concern, j=self.journal,
                                  fsync=self.fsync, **kwargs)

src/k/o/kombu-HEAD/kombu/transport/mongodb.py   kombu(Download)
from pymongo import errors
from anyjson import loads, dumps
from pymongo import MongoClient, uri_parser
 
from kombu.five import Empty
    def _open(self, scheme='mongodb://'):
        hostname, dbname, options = self._parse_uri(scheme=scheme)
 
        mongoconn = MongoClient(
            host=hostname, ssl=options['ssl'],

src/p/y/pycourse-HEAD/modules/mod_05_pymongo.py   pycourse(Download)
 
 
client = pymongo.MongoClient('localhost', 27017)  # localhost:27017 is the default value
dbconn = client.mod_pymongo  # also client['mod_pymongo'] getting a database is so easy ('use db' in mongo shell)
# db.authenticate(username, password)  # Not enabled in our db right now
from pymongo.errors import AutoReconnect, ConnectionFailure, DuplicateKeyError
replica_client = pymongo.MongoClient(
                ('localhost:27017', 'localhost:27018', 'localhost:27019'), # also you can use url format
                w=3, # globally set write_concern (wtimeout can also be set...).
                replicaset='sdrepl',

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_client(self, **kwargs):
        logger.debug('Loading new MongoClient connection')
        self._proxy = MongoClient(self.host, self.port, tz_aware=self.tz_aware,
                                  w=self.write_concern, j=self.journal,
                                  fsync=self.fsync, **kwargs)

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
    def _load_mongo_client(self, **kwargs):
        logger.debug('Loading new MongoClient connection')
        _proxy = MongoClient(
            self.mongodb_config.get('host'),
            self.mongodb_config.get('port'),

src/s/t/stock-labs-HEAD/python-pymongo/handlers/Base.py   stock-labs(Download)
from bson import json_util
from datetime import datetime
from json import dumps
from logging import getLogger as log
from pymongo import MongoClient
    def distinct(self, args):
        options = self.application.options
        connection = MongoClient(options.db_host, options.db_port, 
            max_pool_size = 0, auto_start_request = True, use_greenlets = False)
        db = connection[options.db_name]
    def find(self, symbol):
        options = self.application.options
        connection = MongoClient(options.db_host, options.db_port, 
            max_pool_size = 0, auto_start_request = True, use_greenlets = False)
        db = connection[options.db_name]

src/o/n/onadata-HEAD/onadata/settings/common.py   onadata(Download)
from django.utils.log import AdminEmailHandler
import djcelery
from pymongo import MongoClient
 
 
 
MONGO_CONNECTION = MongoClient(
    MONGO_CONNECTION_URL, safe=True, j=True, tz_aware=True)
MONGO_DB = MONGO_CONNECTION[MONGO_DATABASE['NAME']]
 

src/f/o/formhub-HEAD/formhub/settings.py   formhub(Download)
from django.core.exceptions import SuspiciousOperation
 
from pymongo import MongoClient
 
 
 
MONGO_CONNECTION = MongoClient(
    MONGO_CONNECTION_URL, safe=True, j=True, tz_aware=True)
MONGO_DB = MONGO_CONNECTION[MONGO_DATABASE['NAME']]
 

src/c/b/cbtool-HEAD/lib/stores/mongodb_datastore_adapter.py   cbtool(Download)
from lib.auxiliary.config import get_my_parameters, set_my_parameters 
 
from pymongo import MongoClient
from pymongo import errors as PymongoException
 
 
            if tout > 0:
                _conn = MongoClient(host = self.host, port = self.port, \
                                    max_pool_size=10)
            else :
                _conn = MongoClient(host = self.host, port = self.port, \
 
            if tout > 0:
                _conn = MongoClient(host = self.host, port = self.port)
            else :
                _conn = MongoClient(host = self.host, port = self.port)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next