Created
April 12, 2017 09:02
-
-
Save DerSchimi/b94d30d563b6cb67de3adb2eb18b43ae to your computer and use it in GitHub Desktop.
groovy mongodb
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
@Grab("com.gmongo:gmongo:1.0") | |
import com.gmongo.GMongo | |
def host = "host" | |
def port = "port" | |
def dbName = "dbname" | |
def gmongo = new GMongo("${host}:${port}") | |
def db = gmongo.getDB(dbName) | |
db.getCollectionNames().each{ | |
println "collection: " +it + " size: " +it.size(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment