Deleting a Document (persistent.deleteDocument)
Always use carefull!
You can use persistent.deleteDocument
to permanently remove a specific document from the database by using its unique identifier (ID).
Syntax
persistent.deleteDocument(ddName, documentId);
Parameters
The deleteDocument function takes the following parameters:
Parameter | Type | Required | Description |
---|---|---|---|
ddName | String or null |
Yes | If the value is null , BizzStream will use the name of the document from which the script was started. |
documentId | String | Yes | The unique identifier (ID) of the document to delete. |
Return value
This function performs an action and does not return a value.
Example
The following example shows how to delete a document from the database by ID:
persistent.deleteDocument(serverDocument._documentDefinitionName, serverDocument._id);