dist/storageEngine/RedisStorageEngine.js
/**
     * Filter for an object and return after the first search success
     * @param fn filter function to use
     * @param ids array of ids that should be used for the filtering
     * @param namespace namespace of the filter
     * @returns the first result or null if nothing was found
     */
Filter for an object and return after the first search success
@param fn filter function to use
@param ids array of ids that should be used for the filtering
@param namespace namespace of the filter
@returns the first result or null if nothing was found
Filter for an object and return after the first search success @param fn filter function to use @param ids array of ids that should be used for the filtering @param namespace namespace of the filter @returns the first result or null if nothing was found
async find(fn, ids = null, namespace) {
        let data = [];
        if (typeof ids === "string" && !namespace) {
            namespace = ids;
            ids = null;
        }
        if (!ids) {
            data = await this.getListMembers(namespace);
        }
        else {
            data = ids;
        }
        data = data.map(id => `${namespace}.${id}`);
        let index = 0;
        for (const key of data) {
            const resolvedData = await this.get(key);
            if (resolvedData && fn(resolvedData, index, data)) {
                return resolvedData;
            }
            index++;
        }
        return null;
    }
async find ( fn , ids = null , namespace ) { let data = [ ] ; if ( typeof ids === "string" && ! namespace ) { namespace = ids ; ids = null ; } if ( ! ids ) { data = await this . getListMembers ( namespace ) ; } else { data = ids ; } data = data . map ( id => ` ${ namespace } ${ id } ` ) ; let index = 0 ; for ( const key of data ) { const resolvedData = await this . get ( key ) ; if ( resolvedData && fn ( resolvedData , index , data ) ) { return resolvedData ; } index ++ ; } return null ; }
Filter for an object and return after the first search success
 @param fn filter function to use
 @param ids array of ids that should be used for the filtering
 @param namespace namespace of the filter
 @returns the first result or null if nothing was found
Filter for an object and return after the first search success @param fn filter function to use @param ids array of ids that should be used for the filtering @param namespace namespace of the filter @returns the first result or null if nothing was found