Skip to main content

Clear

clear is used to remove all records from a table.

You can also use delete api to clear records from particular table but clear will be fast and won't return no of record deleted while delete will return no of record deleted.

await connection.clear(table_name);
console.log('data cleared successfully');

Example