Last active
August 29, 2015 14:07
-
-
Save normgraham/3163401e75e35d62cbf1 to your computer and use it in GitHub Desktop.
Print documents from system.users collections in all databases
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var listUsers = function () { | |
| db.adminCommand({"listDatabases":1}).databases.forEach(function(doc) { | |
| print(doc.name + ":"); | |
| db.getSiblingDB(doc.name).getCollection("system.users").find().forEach(printjson); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment