diff options
author | James Wahlin <james.wahlin@10gen.com> | 2016-07-18 12:09:24 -0400 |
---|---|---|
committer | James Wahlin <james.wahlin@10gen.com> | 2016-07-19 10:10:43 -0400 |
commit | 97c43492de001c1bfd9426107c919ab50f1829ab (patch) | |
tree | 7825b00a90f53800cc46c67cd11b63298a944e66 /jstests/hooks | |
parent | 1b0320d123393e77f8ec0380dd8f9a725709cb1e (diff) | |
download | mongo-97c43492de001c1bfd9426107c919ab50f1829ab.tar.gz |
SERVER-24506 listCollections support for views
Diffstat (limited to 'jstests/hooks')
-rw-r--r-- | jstests/hooks/validate_collections.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/jstests/hooks/validate_collections.js b/jstests/hooks/validate_collections.js index 5024460f05a..946a0663894 100644 --- a/jstests/hooks/validate_collections.js +++ b/jstests/hooks/validate_collections.js @@ -20,9 +20,14 @@ function validateCollections(db, obj) { var full = obj.full; var success = true; - var collNames = db.getCollectionNames(); - for (var collName of collNames) { - var coll = db.getCollection(collName); + + // Don't run validate on view namespaces. + let listCollectionsRes = db.runCommand({listCollections: 1, filter: {"type": "collection"}}); + assert.commandWorked(listCollectionsRes); + let collInfo = new DBCommandCursor(db.getMongo(), listCollectionsRes).toArray(); + + for (var collDocument of collInfo) { + var coll = db.getCollection(collDocument["name"]); var res = coll.validate(full); if (!res.ok || !res.valid) { |