(self, collection=None)
This method is responsible for defining the necessary interface to
        connect to a NoSQL database, using an established mongod client.
def connect(self, collection=None):
        '''

        This method is responsible for defining the necessary interface to
        connect to a NoSQL database, using an established mongod client.

        '''

        try:
            # single mongodb instance
            database = Database().get_db('nosql')
            self.database = self.client[database]

            if collection:
                self.collection = self.database[collection]

            return {
                'status': True,
                'error': None,
            }

        except errors, error:
            self.proceed = False
            self.list_error.append(error)

            return {
                'status': False,
                'error': self.list_error,
            }
def connect ( self , collection = None ) : try : # single mongodb instance database = Database ( ) . get_db ( 'nosql' ) self . database = self . client [ database ] if collection : self . collection = self . database [ collection ] return { 'status' : True , 'error' : None , } except errors , error : self . proceed = False self . list_error . append ( error ) return { 'status' : False , 'error' : self . list_error , }