table_drop
ReQL command: table_drop
Command syntax
db.table_drop(table_name) → object
Description
Drop a table. 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
: alwaysnil
.
-
If the given table does not exist in the database, the command throws ReqlRuntimeError
.
Example: Drop a table named ‘dc_universe’.
r.db('test').table_drop('dc_universe').run(conn) { :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 => nil } ], :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/ruby/table_drop/