Did I find the right examples for you? yes no

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)
Get the database named in the MongoDB connection URI.

>>> uri = 'mongodb://host/my_database'
>>> client = MongoClient(uri)
>>> db = client.get_default_database()
>>> assert db.name == 'my_database'

Useful in scripts where you want to choose which database to use
based only on the URI in a configuration file.

src/m/o/mongorm-0.7.0/mongorm/database.py   mongorm(Download)
                self.__db__ = self.__client__[kwargs['db']]
            else:
                self.__db__ = self.__client__.get_default_database()
        else:
            self.__client__ = MongoClient(

src/m/o/mongu-0.4.2/mongu.py   mongu(Download)
        self.client = MongoClient(*args, **kwargs)
        try:
            db = self.client.get_default_database()
        except ConfigurationError:
            pass

src/m/o/mongu-HEAD/mongu.py   mongu(Download)
        self.client = MongoClient(*args, **kwargs)
        try:
            db = self.client.get_default_database()
        except ConfigurationError:
            pass