clc map

Map commands are a group of map operations.

Usage:

clc map [command] [options]

clc map clear

Removes all entries from the map.

Usage:

clc map clear --name <name of your map>

Parameters:

Parameter Required Description Default

--name, -n

Required

Name of the map.

default

clc map get

Prints a single entry from the map as a key-value pair.

Usage:

clc map get --name <name of your map>
            [--key-type {string (default), bool, json, i8, i16, i32, i64, f32, f64}]
            [key]

Parameters:

Parameter Required Description Default

--name, -n

Required

Name of the map.

dev

key

Required

Key of the map entry.

N/A

--key-type, -k

Optional

Data type of the key.

String

Example:

clc map get --name yearbook 2012 --key-type i16

clc map set

Sets the given key-value entry pair in a map.

Usage:

clc map set --name <name of your map>
            [key]
            [value]
            [--key-type {string (default), bool, json, i8, i16, i32, i64, f32, f64}]
            [--value-type {string (default), bool, json, i8, i16, i32, i64, f32, f64}]
            [--ttl {ns, us, ms, s, m, h (nanosecond, microsecond, millisecond, second, minute, hour)}]
            [--max-idle {ns, us, ms, s, m, h (nanosecond, microsecond, millisecond, second, minute, hour)}]

Parameters:

Parameter Required Description Default

--name, -n

Required

Name of the map.

dev

key

Required

Key of the map entry.

N/A

value

Required

Value to set for the key. Mutually exclusive with --value-file.

N/A

--key-type, -k

Optional

Data type of the key.

String

--value-type, -v

Optional

Data type of the value.

String

--ttl

Optional

Duration in milliseconds after which the entry will expire and be evicted. It cannot be shorter than 1 second (1000 ms).

N/A

--max-idle

Optional

Maximum time for this entry to stay idle in the map. It cannot be shorter than 1 second (1000 ms).

N/A

Example:

clc map set --key-type string hello --value-type f32 19.94 --name myMap --ttl 1300ms

clc map entry-set

Gets all the entries of the specified map.

Usage:

clc map entry-set --name <name of your map>

Parameters:

Parameter Required Description Default

--name, -n

Required

Name of the map.

dev

Example:

clc map entry-set -n myMap

clc map size

Prints the size of the given the map.

Usage:

clc map size --name <name of your map>

Parameters:

Parameter Required Description Default

--name, -n

Required

Name of the map.

dev

clc map remove

Deletes the value of a given key in a map.

Usage:

clc map remove --name <name of your map>
               [key]
               [--key-type {string (default), bool, json, i8, i16, i32, i64, f32, f64}]

Parameters:

Parameter Required Description Default

--name, -n

Required

Name of the map.

dev

key

Required

Key of the map entry.

N/A

--key-type, -k

Optional

Data type of the key.

String

Example:

clc map remove --name myMap --key-type string k1