0

i have 2 mongodb database,

1 in in my local host

and 2nd in in other computer

here Myinfo <= database name

CustomerDetails <= table Name

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

i want to copy all collection of CustomerDetails to another db at :

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

how can i do that? ` Note: i do not want to copy whole db , just only one table!

vir
  • 1,081
  • 4
  • 19
  • 31
  • possible duplicate of [What's the fastest way to copy a collection within the same database?](http://stackoverflow.com/questions/10624964/whats-the-fastest-way-to-copy-a-collection-within-the-same-database) (it's the same answer whether a different db or not). Btw mongo doesn't have tables :) it has _collections_. – AD7six Mar 21 '14 at 11:41

1 Answers1

0

Use the method from the target host, in the shell:

> use MyInfo
> db.cloneDatabase("origin hostname/ or IP")
Neil Lunn
  • 148,042
  • 36
  • 346
  • 317