{"action":"created","issue":{"url":"https://api.github.com/repos/TylerBrock/mongo-hacker/issues/133","labels_url":"https://api.github.com/repos/TylerBrock/mongo-hacker/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/TylerBrock/mongo-hacker/issues/133/comments","events_url":"https://api.github.com/repos/TylerBrock/mongo-hacker/issues/133/events","html_url":"https://github.com/TylerBrock/mongo-hacker/pull/133","id":70132796,"number":133,"title":"New API method: db.getMongo().getDatabaseNames()","user":{"login":"pvdb","id":17322,"avatar_url":"https://avatars.githubusercontent.com/u/17322?v=3","gravatar_id":"","url":"https://api.github.com/users/pvdb","html_url":"https://github.com/pvdb","followers_url":"https://api.github.com/users/pvdb/followers","following_url":"https://api.github.com/users/pvdb/following{/other_user}","gists_url":"https://api.github.com/users/pvdb/gists{/gist_id}","starred_url":"https://api.github.com/users/pvdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pvdb/subscriptions","organizations_url":"https://api.github.com/users/pvdb/orgs","repos_url":"https://api.github.com/users/pvdb/repos","events_url":"https://api.github.com/users/pvdb/events{/privacy}","received_events_url":"https://api.github.com/users/pvdb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-22T13:57:23Z","updated_at":"2015-05-09T09:25:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/TylerBrock/mongo-hacker/pulls/133","html_url":"https://github.com/TylerBrock/mongo-hacker/pull/133","diff_url":"https://github.com/TylerBrock/mongo-hacker/pull/133.diff","patch_url":"https://github.com/TylerBrock/mongo-hacker/pull/133.patch"},"body":"Hey @TylerBrock,\r\n\r\nThis PR adds a new API method to the MongoDB shell: `db.getMongo().getDatabaseNames()` which returns a list of database names, similar to how `db.getCollectionNames()` returns a list of collection names.\r\n\r\nThe rationale for introducing this new API method is that it allows for advanced cross-database scripting within a single MongoDB shell session... I plan to use it as the basis for a new `count collections` helper which will print out a list of database names followed by the number of collections in each of them.\r\n\r\nBased on this new API method, I was then also able to refactor/simplify the implementation of the `show dbs` helper, which makes up the remaining commits in this PR _(which I've kept very small again, similar to what I did in #129, which should make reviewing the PR a bit easier)_.\r\n\r\nThanks, @pvdb!\r\n\r\n![get_database_names](https://cloud.githubusercontent.com/assets/17322/7276127/a03d9d88-e8ff-11e4-9d7a-eadbd788c7ec.png)\r\n"},"comment":{"url":"https://api.github.com/repos/TylerBrock/mongo-hacker/issues/comments/100454969","html_url":"https://github.com/TylerBrock/mongo-hacker/pull/133#issuecomment-100454969","issue_url":"https://api.github.com/repos/TylerBrock/mongo-hacker/issues/133","id":100454969,"user":{"login":"pvdb","id":17322,"avatar_url":"https://avatars.githubusercontent.com/u/17322?v=3","gravatar_id":"","url":"https://api.github.com/users/pvdb","html_url":"https://github.com/pvdb","followers_url":"https://api.github.com/users/pvdb/followers","following_url":"https://api.github.com/users/pvdb/following{/other_user}","gists_url":"https://api.github.com/users/pvdb/gists{/gist_id}","starred_url":"https://api.github.com/users/pvdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pvdb/subscriptions","organizations_url":"https://api.github.com/users/pvdb/orgs","repos_url":"https://api.github.com/users/pvdb/repos","events_url":"https://api.github.com/users/pvdb/events{/privacy}","received_events_url":"https://api.github.com/users/pvdb/received_events","type":"User","site_admin":false},"created_at":"2015-05-09T09:25:54Z","updated_at":"2015-05-09T09:25:54Z","body":"Hey @TylerBrock, I've got some other pull requests queued up behind this one, so it'd be great if you'd be able to have a look at this one... thanks!"}}