monster.util.dataFlags.add()

Syntax

monster.util.dataFlags.add(flags, object);

Parameter

flags: Object (mandatory)

Name of the flag we want to get the value of.

object: Object (mandatory)

Object to merge the flags into.

Return

The updated object (to allow for chaining, as the object itself is already updated by reference)

Description

Allows developer to add flags in object before saving them in database.

Examples

var user = {
    first_name: 'JR',
    last_name: 'Maitre'
}

monster.util.dataFlags.add({'source': 'smartpbx', 'version': '0.1'}, user); 

/* would return
{
    first_name: 'JR',
    last_name: 'Maitre',
    markers: {
        monster: {
            source: 'smartpbx',
            version: '0.1'
        }
    }
};
*/

Edit this page here