del

Delete a item from a dict by its key.

This function generates a change.

Function

dict.del(key)

Arguments

Argument Type Description
key str/int/uuid (required) Key for the item to delete.

Return value

Returns the removed value if successful. A lookup_err() is returned if the key does not exist.

Example

This code shows some return values for del():

d = dict([[123, 'Hello ThingsDB!']]);
d.del(123);

Return value in JSON format

"Hello ThingsDB!"