On the api documentation page rethinkdb.com/api/javascript I can only find commands to create, drop and list databases.
But how I can I rename a database in RethinkDB?
You basically have two options:
1. Update the name using the .config
method
You can also update the name using the .config
method every database and tables has. This would look something like this:
r
.db("db_name")
.config()
.update({name: "new_db_name"})
2. Update the db_config
table
You can also execute a query on the db_config
table and just do an update on the db you want to change. This would look something like this:
r
.db('rethinkdb')
.table('db_config')
.filter({ name: 'old_db_name' })
.update({ name: 'new_table_name'})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With