Created
January 6, 2015 03:03
-
-
Save nidate/6d07d1c757428159fc36 to your computer and use it in GitHub Desktop.
mongoDBでcollectionの一覧を取得する #一行野郎
This file contains 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
mongo dbname --quiet --eval 'db.getCollectionNames().sort().join("\n")' | |
# mongo shellの 'show collections' はJavaScriptの命令ではないので、evalに渡せない。 | |
# http://docs.mongodb.org/manual/reference/mongo-shell/#administrative-command-helpers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment