Did I find the right examples for you? yes no

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)

src/b/e/bench-HEAD/mongo_database.py   bench(Download)
 
from base_database import BaseDatabase
from config import MONGO_FLAGS, MONGO_USER, MONGO_PWD, MONGO_DROP_DATABASE, MONGO_SHARDED_DATABASE
 
class MongoDatabase(BaseDatabase):
    def __init__(self):
        self.connection = pymongo.Connection(**MONGO_FLAGS)
        self.db = self.connection.game
        self.admin = self.connection.admin
        if MONGO_USER != '': 
            try:
                self.db.authenticate(MONGO_USER,MONGO_PWD)