tableDrop
ReQL command: tableDrop
Command syntax
db.tableDrop(tableName) → object
Description
Drop a table from a database. The table and all its data will be deleted.
If successful, the command returns an object with two fields:
-
tables_dropped
: always1
. -
config_changes
: a list containing one two-field object,old_val
andnew_val
:-
old_val
: the dropped table’s config value. -
new_val
: alwaysnull
.
-
If the given table does not exist in the database, the command throws ReqlRuntimeError
.
Example: Drop a table named ‘dc_universe’.
> r.db('test').tableDrop('dc_universe').run(conn, callback); // Result passed to callback { "config_changes": [ { "old_val": { "db": "test", "durability": "hard", "id": "20ea60d4-3b76-4817-8828-98a236df0297", "name": "dc_universe", "primary_key": "id", "shards": [ { "primary_replica": "rethinkdb_srv1", "replicas": [ "rethinkdb_srv1", "rethinkdb_srv2" ] } ], "write_acks": "majority" }, "new_val": null } ], "tables_dropped": 1 }
Related commands
Get more help
Couldn't find what you were looking for?
- Ask a question on Stack Overflow
- Chat with us and our community on Slack
- Talk to the team on IRC on #rethinkdb@freenode.net — via Webchat
- Ping @rethinkdb on Twitter
- Post an issue on the documentation issue tracker on GitHub
© RethinkDB contributors
Licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
https://rethinkdb.com/api/javascript/table_drop/