imports/vx/client/code/vxapp.js
/**
     * Simple update handler to use when overriding default behavior at component level.
     * You can upate any collection and field by supplying the parameters below.
     *
     * @param {object} collection MongoDB collection to update.
     * @param {object} record Record to be updated.
     * @param {string} rowsPath Lodash-style update path.
     * @param {?} value New value.
     */
Simple update handler to use when overriding default behavior at component level.
You can upate any collection and field by supplying the parameters below.

@param {object} collection MongoDB collection to update.
@param {object} record Record to be updated.
@param {string} rowsPath Lodash-style update path.
@param {?} value New value.
Simple update handler to use when overriding default behavior at component level . You can upate any collection and field by supplying the parameters below . @param { object } collection MongoDB collection to update . @param { object } record Record to be updated . @param { string } rowsPath Lodash - style update path . @param { ? } value New value .
updateHandlerSimple(collection, record, rowsPath, value) {
        const mongoPath = Util.toMongoPath(rowsPath)
        const modifier = {}
        modifier.$set = {}
        modifier.$set[mongoPath] = value
        OLog.debug(`vxapp.js updateHandlerSimple collection=${collection._name} recordId=${record._id} ` +
            `rowsPath=${rowsPath} mongoPath=${mongoPath} modifier=${OLog.debugString(modifier)}`)
        collection.update(record._id, modifier, error => {
            if (error) {
                UX.notifyForError(error)
                return
            }
            OLog.debug(`vxapp.js updateHandlerSimple collection=${collection._name} recordId=${record._id} *success*`)
        })
    }
updateHandlerSimple ( collection , record , rowsPath , value ) { const mongoPath = Util . toMongoPath ( rowsPath ) const modifier = { } modifier . $set = { } modifier . $set [ mongoPath ] = value OLog . debug ( ` ${ collection . _name } ${ record . _id } ` + ` ${ rowsPath } ${ mongoPath } ${ OLog . debugString ( modifier ) } ` ) collection . update ( record . _id , modifier , error => { if ( error ) { UX . notifyForError ( error ) return } OLog . debug ( ` ${ collection . _name } ${ record . _id } ` ) } ) }
Simple update handler to use when overriding default behavior at component level.
Simple update handler to use when overriding default behavior at component level .