How to rename a database in RethinkDB -
on api documentation page rethinkdb.com/api/javascript can find commands create, drop , list databases.
but how can rename database in rethinkdb?
you have 2 options:
1. update name using .config method
you can update name using .config method every database , tables has. this:
r .db("db_name") .config() .update({name: "new_db_name"}) 2. update db_config table
you can execute query on db_config table , update on db want change. this:
r .db('rethinkdb') .table('db_config') .filter({ name: 'old_db_name' }) .update({ name: 'new_table_name'})
Comments
Post a Comment