Data Loss Warning: This operation permanently deletes all data in the table.
Syntax
Arguments
List of arguments to provide.Name of the table to drop. Must be an existing table name within the database.
Optargs
No optional arguments.Returns
Information about the operation.
Behavior
- When called without a database context (
r.tableDrop()), operates on the default database. - When called with a database context (
r.db().tableDrop()), operates on the specified database. - Permanently deletes the specified table and all its documents.
 - All secondary indexes associated with the table are also deleted.
 - The operation is atomic - either the table is completely dropped or an error occurs.
 - Once dropped, the table and its data cannot be recovered unless you have backups.
 - If the table doesn’t exist, an error is thrown.
 
Notes & Caveats
- All secondary indexes on the table are automatically dropped.
 - Any ongoing queries on the table will fail after the table is dropped.
 - Reserved system tables cannot be dropped.
 - Consider creating backups before dropping important tables.
 
Example
Drop a simple table
Drop a table from the default database.Drop a table from specific database
Drop a table from the ecommerce database.Drop multiple tables
Drop several related tables in sequence.Related Functions
r- Referencing the query builderdb- Referencing a databasetable- Referencing a tabletableCreate- Creating a tabletableList- Listing tablesdelete- Deleting documents (alternative to dropping entire table)dbDrop- Dropping an entire database
Found a typo? Or maybe a broken link? RuloDB is open-source, help us fix it!

