发布于 2015-09-14 15:14:17 | 275 次阅读 | 评论: 0 | 来源: 网络整理
-
db.cloneCollection(from, collection, query)
db.cloneCollection() provides a wrapper around
cloneCollection for copying data directly between
MongoDB instances. db.cloneCollection() does not allow
you to clone a collection through a mongos: you must
connect directly to the mongod instance.
参数: |
- from (string) – A host name, of the MongoDB instance that holds
the collection you wish to copy
- collection (string) – A collection in the MongoDB instance that
you want to
copy. db.cloneCollection() will
only copy the collection with this name
from database of the same name as the
current database the remote MongoDB
instance. If you want to copy a
collection from a different database name
you must use the
cloneCollection directly.
- query (document) – Optional. A standard MongoDB query
document to limit
the documents copied as part of the
db.cloneCollection() operation.
|