anwalsh/MigrationSourceValidator

Allow for Source Data Structures to be provided via JSON File

Closed this issue · 1 comments

Using a shell command for gathering the index details from a source:

rs.slaveOk();
db.getMongo().getDBNames().forEach(function(d) {
    if (d != "config" && d != "local" && d != "admin") {
        var curr_db = db.getSiblingDB(d);
        curr_db.getCollectionNames().forEach(function(coll) {
            var c = curr_db.getCollection(coll);
            if (typeof c != "function") {
                printjson(c.getIndexes());
                printjson(c.stats());
            }
        });
    }
});

Be able to validate the index shapes therein.

Can this shell command be something that is echo’d by this validation tool (via passing in an option or something), that way we don’t have to actually remember the entirety of that shell command and people run the proper command to generate the JSON document we expect?

This has the added benefit of being able to change the command/validation logic of the expected JSON doc over time.