'The DB.'

@property
def db(self):

    try:
        return self._db
    except AttributeError:
        self._db = self.db_client[self.dbname]
        if (self.username is not None):
            if (self.password is not None):
                self.db.authenticate(self.username, self.password)
            elif (self.mechanism is not None):
                self.db.authenticate(self.username, mechanism=self.mechanism)
            else:
                raise TypeError("provide    either    'password'    or    'mechanism'    with    'username'")
        return self._db
