utils/trackedUsersCache.js
function update(sessionId, info) {
        sessionIdCache[sessionId] = info;

        db.collection('trackedUsersCache').update({
            _id: sessionId,
        }, { $set: {
            info: info,
        }}, {
            upsert: true
        }, (err) => {
            if (errorHandler.dbErrorCatcher(err)) { return false; }
            return true;
        });

    }
function update(sessionId, info) {
        sessionIdCache[sessionId] = info;

        db.collection('trackedUsersCache').update({
            _id: sessionId,
        }, { $set: {
            info: info,
        }}, {
            upsert: true
        }, (err) => {
            if (errorHandler.dbErrorCatcher(err)) { return false; }
            return true;
        });

    }
function update ( sessionId , info ) { sessionIdCache [ sessionId ] = info ; db . collection ( 'trackedUsersCache' ) . update ( { _id : sessionId , } , { $set : { info : info , } } , { upsert : true } , ( err ) => { if ( errorHandler . dbErrorCatcher ( err ) ) { return false ; } return true ; } ) ; }
Adding the id and the information in the cache. If we already have it, we update it
Adding the id and the information in the cache . If we already have it we update it