Cleanup
Removes expired key-value pairs from the database.
- Returns:
- The result of the operation, includes the number of rows affected by the operation or an error if the operation failed.
const result = db.cleanup();
if (result.success) {
console.log(`Cleaned up ${result.data} rows`);
} else {
console.log(result.error.message);
}
note
Regularly run the cleanup()
method to optimize the database and reduce its size.