1. Home
  2. MongoDB Tutorial
  3. MongoDB Copy Database

MongoDB Copy Database

copyDatabase() verifiably creates the goal databases if it doesn’t exist on the off chance that you don’t determine the hostname contention.

Syntax:

db.copyDatabase(fromdb, todb, fromhost, username, password, mechanism)

Example:

db.copyDatabase("FOSSTECHNIX","FOSSTECHNIX_COPY");

Here we have covered MongoDB Copy Database.

How can we help?