On this page本页内容
db.
cloneDatabase
("hostname")¶Deprecated since version 4.0.自版本4.0以来已弃用。
Important
Starting in version 4.2, MongoDB removes the 从4.2版开始,MongoDB删除clone
command. clone
命令。The deprecated 不推荐使用的db.cloneDatabase()
, which wraps the clone
command, can only be run against MongoDB 4.0 or earlier versions. db.cloneDatabase()
,它封装了clone
命令,只能在MongoDB 4.0或更早版本上运行。For behavior and examples, refer to the 4.0 or earlier version of the manual.有关行为和示例,请参阅4.0或更早版本的手册。
For an alternative in version 4.2+, see Copy/Clone a Database.有关版本4.2+中的替代方案,请参阅Copy/Clone a Database。
Copies a remote database to the current database. 将远程数据库复制到当前数据库。The command assumes that the remote database has the same name as the current database.该命令假定远程数据库与当前数据库具有相同的名称。
hostname |
string |