Enables “commit history” for a given scope. Commit history can be enabled for collections scopes and the @thingsdb scope.
Disabling commit history will permanently delete all existing historical records for this scope. This action cannot be undone.
When enabled, the following functions require a commit(..) before they can be used:
Use the history() function to view the commits in the history log and del_history() to remove commits from the history log.
This function generates a change.
set_history(scope, state)
| Argument | Type | Description |
|---|---|---|
scope |
str | Can be either the @thingsdb or a @collection scope. |
state |
bool | true to enable commit history, false to disable commit history. |
The value nil.
This code enables commit history for the “stuff” collection:
set_history('//stuff', true);
Return value in JSON format
null