Skip to content
Database dbDelete

$dbDelete

$dbDelete removes the document. Deleting a document that does not exist is not an error.

Syntax

$dbDelete[collection;id;(returnValue)]

Parameters

Parameter Description
collection Collection name: lowercase letters, digits, _, . or - (up to 64 characters). It is created on first write.
id Document id, 1 to 128 bytes. Often a Discord ID.
returnValue Optional - yes to return the result, no to return nothing. Absent: a call written on its own prints nothing, a call used as a value ($var[r;$dbSet[...]]) returns it. Any other value raises an error.

Return value

Used on its own in a script, the function prints nothing, so no revision or JSON leaks into the message. Used as a value of another function, or with returnValue set to yes, it returns the result below.

  • true when a document was deleted, false otherwise.

Examples

$dbDelete[players;$authorID]
Your data was deleted.

Try it

Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.