如何将一张mongodb表复制到另一个位于不同位置的mongodb表?

时间:2014-03-21 11:16:01

标签: mongodb

我有2个mongodb数据库,

在我当地的主人身上1英寸

和其他计算机中的第二名

here Myinfo <= database name

CustomerDetails <= table Name

let's see 1st : `Localhost / Myinfo / CustomerDetails`

我想将所有CustomerDetails集合复制到另一个数据库:

let's say 2nd : `192.168.1.10/ Myinfo / CustomerDetails

我该怎么做? ` 注意:我不想复制整个数据库,只需要一个表!

1 个答案:

答案 0 :(得分:0)

使用shell中目标主机的方法:

> use MyInfo
> db.cloneDatabase("origin hostname/ or IP")