dist/storageEngine/RedisStorageEngine.js
/**
     * Upsert an object into the cache
     * @param id id of the object
     * @param updateData the new Data which get's merged with the old
     * @param useHash whether to use hash objects for this action
     */
Upsert an object into the cache
@param id id of the object
@param updateData the new Data which get's merged with the old
@param useHash whether to use hash objects for this action
Upsert an object into the cache @param id id of the object @param updateData the new Data which get ' s merged with the old @param useHash whether to use hash objects for this action
upsert(id, updateData, useHash = this.useHash) {
        let data;
        return new Promise(async (res, rej) => {
            var _a, _b;
            if (useHash) {
                (_a = this.client) === null || _a === void 0 ? void 0 : _a.HMSET(id, updateData, (err) => {
                    if (err)
                        void rej(err);
                    else
                        void res(undefined);
                });
            }
            else {
                try {
                    data = await this.get(id);
                }
                catch (e) {
                    rej(e);
                }
                data = data || {};
                Object.assign(data, updateData);
                (_b = this.client) === null || _b === void 0 ? void 0 : _b.SET(id, this.prepareData(data), (err) => {
                    if (err)
                        void rej(err);
                    else
                        void res(undefined);
                });
            }
        });
    }
upsert ( id , updateData , useHash = this . useHash ) { let data ; return new Promise ( async ( res , rej ) => { var _a , _b ; if ( useHash ) { ( _a = this . client ) === null || _a === void 0 ? void 0 : _a . HMSET ( id , updateData , ( err ) => { if ( err ) void rej ( err ) ; else void res ( undefined ) ; } ) ; } else { try { data = await this . get ( id ) ; } catch ( e ) { rej ( e ) ; } data = data || { } ; Object . assign ( data , updateData ) ; ( _b = this . client ) === null || _b === void 0 ? void 0 : _b . SET ( id , this . prepareData ( data ) , ( err ) => { if ( err ) void rej ( err ) ; else void res ( undefined ) ; } ) ; } } ) ; }
Upsert an object into the cache
 @param id id of the object
 @param updateData the new Data which get's merged with the old
 @param useHash whether to use hash objects for this action
Upsert an object into the cache @param id id of the object @param updateData the new Data which get ' s merged with the old @param useHash whether to use hash objects for this action