checkNotNull(params.get(DB_URI),
DB_URI + " param is required"));
Jongo jongo = new Jongo(new MongoClient(mongoClientURI).getDB(mongoClientURI.getDatabase()));
try {
Stopwatch stopwatch = Stopwatch.createStarted();
MongoCollection collection = jongo.getCollection(given.getCollection());
Iterable<String> items = Splitter.on("\n").trimResults().omitEmptyStrings().split(given.getData());
int count = 0;
for (String item : items) {
collection.insert(item);
count++;
}
System.out.printf("imported %s[%d] -- %s%n", given.getCollection(), count, stopwatch.stop().toString());
} finally {
jongo.getDatabase().getMongo().close();