def delete(self, cfg, triggers_on=True):
collection = cfg[AccessParams.KEY_COLLECTION]<EOL>match_params = cfg[AccessParams.KEY_MATCH_PARAMS] if AccessParams.KEY_MATCH_PARAMS in cfg else {}<EOL>target_type = cfg[AccessParams.KEY_TYPE] if AccessParams.KEY_TYPE in cfg else AccessParams.TYPE_MULTI<EOL>if triggers_on:<EOL><INDENT>self.__exec_trigger(Trigger.ACTION_BEFORE_DELETE, collection, None, match_params)<EOL><DEDENT>if target_type == AccessParams.TYPE_SINGLE:<EOL><INDENT>result = CRUD.delete_single(self.__db, collection, match_params)<EOL><DEDENT>elif target_type == AccessParams.TYPE_MULTI:<EOL><INDENT>result = CRUD.delete_multi(self.__db, collection, match_params)<EOL><DEDENT>if triggers_on:<EOL><INDENT>self.__exec_trigger(Trigger.ACTION_AFTER_DELETE, collection, None, match_params)<EOL><DEDENT>return result<EOL>
Deletes document(s) from MongoDB collection
:param cfg:
    {
        AccessParams.KEY_COLLECTION: <Collection to update>,
        AccessParams.KEY_MATCH_PARAMS: <A query that matches the documents to delete>,
        AccessParams.KEY_TYPE: <AccessParams.TYPE_SINGLE or AccessParams.TYPE_MULTI>
    }
:param triggers_on: enables/disables triggers (default - True)
:return: result of delete operation - id or number of deleted documents