This is the ThingsDB documentation for version v0, click here for the latest version!

mod

Modify a member value from an existing enumerator type.

Action

mod_enum(enum, 'mod', name, value)

Arguments

Argument Type Description
enum str Name of the enumerator type where the member has to be removed from.
'mod' str Passing this argument will result in a modify action.
name str Name of the member that has to be modified.
value any New value for the member that has to be modified.

Return value

The value nil.

Example

This code shows how to use the action mod:

// Create enum `Color`
set_enum('Color', {
    RED: '#ff0000',
    GREEN: '#00ff00',
    BLUE: '#0000aa',
});

// Modify the value for `BLUE`
mod_enum('Color', 'mod', 'BLUE', '#0000ff');

Return value in JSON format

null