|
Yang |
at Aug 5, 2012 at 3:46 pm
|
⇧ |
| |
Do I have to use the same database name at the destination host, or I can
choose to clone a collection to a database with different name?
On Sunday, August 5, 2012 11:00:42 PM UTC+8, Yang wrote:
I try to use "db.cloneCollection()" command to copy a collection from one
database(remote) to another, but I can't see the collection in the
destination database. Why? Here is what I did:
On host A (IP : 192.168.1.11), I have a collection named "user_info" in
the database "test".
On Host B (IP: 192.168.1.22), I run the following command within the mongo
shell:
db.cloneCollection("192.168.1.11", "test.user_info")
The "user_info" collection is small, only tens of documents. The command
completed quickly with an output message: "{ "ok" : 1 }", but when I try to
check the results with the following command:
db.getCollectionNames()
there is no collection named "user_info" which I hoped to have copied from
the remote to local database.
Did I missed something?
On Sunday, August 5, 2012 11:00:42 PM UTC+8, Yang wrote:
I try to use "db.cloneCollection()" command to copy a collection from one
database(remote) to another, but I can't see the collection in the
destination database. Why? Here is what I did:
On host A (IP : 192.168.1.11), I have a collection named "user_info" in
the database "test".
On Host B (IP: 192.168.1.22), I run the following command within the mongo
shell:
db.cloneCollection("192.168.1.11", "test.user_info")
The "user_info" collection is small, only tens of documents. The command
completed quickly with an output message: "{ "ok" : 1 }", but when I try to
check the results with the following command:
db.getCollectionNames()
there is no collection named "user_info" which I hoped to have copied from
the remote to local database.
Did I missed something?
On Sunday, August 5, 2012 11:00:42 PM UTC+8, Yang wrote:
I try to use "db.cloneCollection()" command to copy a collection from one
database(remote) to another, but I can't see the collection in the
destination database. Why? Here is what I did:
On host A (IP : 192.168.1.11), I have a collection named "user_info" in
the database "test".
On Host B (IP: 192.168.1.22), I run the following command within the mongo
shell:
db.cloneCollection("192.168.1.11", "test.user_info")
The "user_info" collection is small, only tens of documents. The command
completed quickly with an output message: "{ "ok" : 1 }", but when I try to
check the results with the following command:
db.getCollectionNames()
there is no collection named "user_info" which I hoped to have copied from
the remote to local database.
Did I missed something?
On Sunday, August 5, 2012 11:00:42 PM UTC+8, Yang wrote:
I try to use "db.cloneCollection()" command to copy a collection from one
database(remote) to another, but I can't see the collection in the
destination database. Why? Here is what I did:
On host A (IP : 192.168.1.11), I have a collection named "user_info" in
the database "test".
On Host B (IP: 192.168.1.22), I run the following command within the mongo
shell:
db.cloneCollection("192.168.1.11", "test.user_info")
The "user_info" collection is small, only tens of documents. The command
completed quickly with an output message: "{ "ok" : 1 }", but when I try to
check the results with the following command:
db.getCollectionNames()
there is no collection named "user_info" which I hoped to have copied from
the remote to local database.
Did I missed something?
On Sunday, August 5, 2012 11:00:42 PM UTC+8, Yang wrote:
I try to use "db.cloneCollection()" command to copy a collection from one
database(remote) to another, but I can't see the collection in the
destination database. Why? Here is what I did:
On host A (IP : 192.168.1.11), I have a collection named "user_info" in
the database "test".
On Host B (IP: 192.168.1.22), I run the following command within the mongo
shell:
db.cloneCollection("192.168.1.11", "test.user_info")
The "user_info" collection is small, only tens of documents. The command
completed quickly with an output message: "{ "ok" : 1 }", but when I try to
check the results with the following command:
db.getCollectionNames()
there is no collection named "user_info" which I hoped to have copied from
the remote to local database.
Did I missed something?
On Sunday, August 5, 2012 11:00:42 PM UTC+8, Yang wrote:
I try to use "db.cloneCollection()" command to copy a collection from one
database(remote) to another, but I can't see the collection in the
destination database. Why? Here is what I did:
On host A (IP : 192.168.1.11), I have a collection named "user_info" in
the database "test".
On Host B (IP: 192.168.1.22), I run the following command within the mongo
shell:
db.cloneCollection("192.168.1.11", "test.user_info")
The "user_info" collection is small, only tens of documents. The command
completed quickly with an output message: "{ "ok" : 1 }", but when I try to
check the results with the following command:
db.getCollectionNames()
there is no collection named "user_info" which I hoped to have copied from
the remote to local database.
Did I missed something?
On Sunday, August 5, 2012 11:00:42 PM UTC+8, Yang wrote:
I try to use "db.cloneCollection()" command to copy a collection from one
database(remote) to another, but I can't see the collection in the
destination database. Why? Here is what I did:
On host A (IP : 192.168.1.11), I have a collection named "user_info" in
the database "test".
On Host B (IP: 192.168.1.22), I run the following command within the mongo
shell:
db.cloneCollection("192.168.1.11", "test.user_info")
The "user_info" collection is small, only tens of documents. The command
completed quickly with an output message: "{ "ok" : 1 }", but when I try to
check the results with the following command:
db.getCollectionNames()
there is no collection named "user_info" which I hoped to have copied from
the remote to local database.
Did I missed something?
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to
mongodb-user@googlegroups.comTo unsubscribe from this group, send email to
mongodb-user+
unsubscribe@googlegroups.comSee also the IRC channel -- freenode.net#mongodb