Created
September 15, 2016 18:14
-
-
Save ibirman/34ea664cc2054865d89594c0ffdb65ab to your computer and use it in GitHub Desktop.
Mongo Get Something from Each Database
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 ld = db.adminCommand( { listDatabases: 1 } ); | |
| ld.databases.forEach(function(dbName){ | |
| var dbx = db.getSiblingDB(dbName.name); | |
| var AccountIds = dbx['Network.Environment'].find().map(function(view){ | |
| if (view.AuditedAccountIds == null || view.AuditedAccountIds == 'undefined'){ | |
| print(dbName.name + ", " + view.AuditedAccountIds); | |
| } | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment