doo.function.audit
The doo.function.audit.delete
function deletes audit records older than a specified datetime in a Tabidoo application. You can optionally limit the deletion to specific tables.
Parameters
applicationId (required)
Type: string
The ID of the application from which the audit records will be deleted.
olderThan (optional)
Type: string
(ISO 8601 datetime format)
Deletes records older than the specified datetime. If omitted, no time constraint is applied.
tableIdList (optional)
Type: array of strings
An array of table IDs to limit the deletion to specific tables. If omitted, records from all tables in the application will be deleted.
Example Usage
1. Delete all audit records from an application
await doo.function.audit.delete({
applicationId: '123456'
});
2. Delete audit records older than January 1, 2024
await doo.function.audit.delete({
applicationId: '123456',
olderThan: '2024-01-01T00:00:00Z'
});
3. Delete audit records older than a specific date for selected tables
await doo.function.audit.delete({
applicationId: '123456',
olderThan: '2024-01-01T00:00:00Z',
tableIdList: ['tableId', 'tableId']
});
Use Cases
- Regular cleanup of audit records to optimize database performance.
- Removing old logs for compliance with data retention policies.
- Limiting audit record deletion to specific tables to maintain necessary logs in other areas.
- Ensuring only outdated audit records are deleted while keeping recent ones for tracking changes.