db_drop
ReQL command: db_drop
Command syntax
r.db_drop(db_name) → object
Description
Drop a database. The database, all its tables, and corresponding data will be deleted.
If successful, the command returns an object with two fields:
-
dbs_dropped
: always1
. -
tables_dropped
: the number of tables in the dropped database. -
config_changes
: a list containing one two-field object,old_val
andnew_val
:-
old_val
: the database’s original config value. -
new_val
: alwaysnil
.
-
If the given database does not exist, the command throws ReqlRuntimeError
.
Example: Drop a database named ‘superheroes’.
r.db_drop('superheroes').run(conn) { :config_changes => [ { :old_val => { :id => "e4689cfc-e903-4532-a0e6-2d6797a43f07", :name => "superheroes" }, :new_val => nil } ], :tables_dropped => 3, :dbs_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/db_drop/