How do you rename a MongoDB database



Even I did not find any command to rename database directly.


To rename database please track  following steps.

1- Copy your old database to new renamed database.

    db.copyDatabase("db_old","db_new_renamed","localhost")

2- Select old database using USE key.

    use db_old

3-  Drop Old Database

     db.dropDatabase();

PostgreSQL-Query: Sort result set by specific field values using ORDER BY Clause

Problem: Suppose we have a book_inventory table which has some columns such as id, isbn, title, author, publisher, publish_date, etc.. whe...