summaryrefslogtreecommitdiff
path: root/src/mongo/db/cloner.h
diff options
context:
space:
mode:
authorJudah Schvimer <judah@mongodb.com>2017-11-07 16:11:52 -0500
committerJudah Schvimer <judah@mongodb.com>2017-11-08 16:38:22 -0500
commit26a5d0070ba4a4b9f7e9a5b68f58a0fa75f9e6d3 (patch)
tree0739316b39c935ae58fb64cf038eac457b2226b9 /src/mongo/db/cloner.h
parent68035d80f3b382e591fa381ee44550d920a6d432 (diff)
downloadmongo-26a5d0070ba4a4b9f7e9a5b68f58a0fa75f9e6d3.tar.gz
SERVER-31805 provide option to Cloner to preserve UUIDs
Diffstat (limited to 'src/mongo/db/cloner.h')
-rw-r--r--src/mongo/db/cloner.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/db/cloner.h b/src/mongo/db/cloner.h
index 6c8cc255b12..796fbe57dad 100644
--- a/src/mongo/db/cloner.h
+++ b/src/mongo/db/cloner.h
@@ -35,6 +35,7 @@
#include "mongo/base/disallow_copying.h"
#include "mongo/client/dbclientinterface.h"
+#include "mongo/db/catalog/collection_options.h"
namespace mongo {
@@ -69,11 +70,18 @@ public:
std::set<std::string>* clonedColls,
std::vector<BSONObj> collectionsToClone = std::vector<BSONObj>());
+ /**
+ * Copies a collection. The optionsParser indicates how to parse the collection options. If
+ * 'parseForCommand' is provided, then the UUID is ignored and a new UUID is generated. If
+ * 'parseForStorage' is provided, then the UUID will be preserved and parsed out of the
+ * options.
+ */
bool copyCollection(OperationContext* opCtx,
const std::string& ns,
const BSONObj& query,
std::string& errmsg,
- bool copyIndexes);
+ bool copyIndexes,
+ CollectionOptions::ParseKind optionsParser);
// Filters a database's collection list and removes collections that should not be cloned.
// CloneOptions should be populated with a fromDB and a list of collections to ignore, which