diff options
author | matt dannenberg <matt.dannenberg@10gen.com> | 2014-02-27 07:54:33 -0500 |
---|---|---|
committer | matt dannenberg <matt.dannenberg@10gen.com> | 2014-03-03 09:44:35 -0500 |
commit | e499f7a2394c19494d55c5b68370a2e53c241778 (patch) | |
tree | c9dd7cfd20025c480cf002b0685d2c25015a7e25 | |
parent | 785b41bb229d49352e883df2fe0f927888772c8f (diff) | |
download | mongo-e499f7a2394c19494d55c5b68370a2e53c241778.tar.gz |
SERVER-12841 upgrade checker gives better errmsg for documents with unindexable _ids
-rw-r--r-- | src/mongo/shell/upgrade_check.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/shell/upgrade_check.js b/src/mongo/shell/upgrade_check.js index 43314848bf1..4efa6a39f9d 100644 --- a/src/mongo/shell/upgrade_check.js +++ b/src/mongo/shell/upgrade_check.js @@ -8,7 +8,14 @@ documentUpgradeCheck = function(indexes, doc) { indexes.forEach(function(idx) { if (keyTooLong({index: idx, doc: doc})) { print("Document:\n\t" + tojson(doc) + "\n\tcannot be indexed by: " + idx.name); - print("Remove this document via the _id field"); + if (idx.name === "_id_") { + print("As a result, this document cannot be removed by its _id index. Instead, " + + "try to remove it by all other fields (omit any fields that have been " + + "identified as unindexable by the upgrade checker)."); + } + else { + print("Remove this document via the _id field"); + } goodSoFar = false; } }); |