-
Type:
Bug
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: mongodump, mongorestore
-
None
-
Platforms 2017-01-23
-
Not Needed
-
v3.4
Repro:
(function() {
if (typeof getToolTest === 'undefined') {
load('jstests/configs/plain_28.config.js');
}
var toolTest = getToolTest('indexes');
var commonToolArgs = getCommonToolArguments();
// where we'll put the dump
var dumpTarget = 'indexes_dump';
resetDbpath(dumpTarget);
// the db and collection we will use
var testDB = toolTest.db.getSiblingDB('test');
var testColl = testDB.coll;
// create v:1 index
testColl.ensureIndex({v1_field: 1}, {name: "v1_field_1", v: 1});
var indexSpec = testColl.getIndexes().filter(spec => spec.name === "v1_field_1")[0];
assert.eq(1, indexSpec.v);
// dump the data
var ret = toolTest.runTool.apply(toolTest, ['dump']
.concat(getDumpTarget(dumpTarget))
.concat(commonToolArgs));
assert.eq(0, ret);
// drop the collection
testColl.drop();
// restore the data
ret = toolTest.runTool.apply(toolTest, ['restore']
.concat(getRestoreTarget(dumpTarget))
.concat(commonToolArgs));
assert.eq(0, ret);
indexSpec = testColl.getIndexes().filter(spec => spec.name === "v1_field_1")[0];
// this assertion should pass, but it fails
assert.eq(1, indexSpec.v);
// success
toolTest.stop();
}());
- related to
-
TOOLS-1534 Running mongodump then mongorestore should restore the _id index with its exact original spec
-
- Closed
-