#!/bin/bash
DATABASE_NAME=testdb
function mongo_dump {
mongo `docker inspect -f '{{range .NetworkSettings.Networks}}{{.
print("\n\nmongodb .. dump .. start \n\n");
db.getCollectionNames().
// find the last item in a collection
var last_element = db[collname].find().sort({_id:
// check that it's not empty
if (last_element.hasNext()) {
// print its timestamp
printjson(last_element.next()
}
})
print("\n\nmongodb .. dump .. end \n\n");
EOF
}
function etcd_dump() {
ETCDCTL_API=3 etcdctl --endpoints=`docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' docker_registry_1`:2379 get "" --prefix=true
}
function etcd_cleanup() {
ETCDCTL_API=3 etcdctl del "" --prefix=true
}