Skip to content

Instantly share code, notes, and snippets.

View davichoso's full-sized avatar

David Ovando davichoso

View GitHub Profile
@davichoso
davichoso / HOWTO.md
Created October 22, 2021 16:01 — forked from marufshidiq/HOWTO.md
Backup and Restore mongodb inside docker-compose container

How to backup

docker-compose exec -T <mongodb_service_name> mongodump --archive --gzip --db <mongodb_database> > dump.gz

How to restore

docker-compose exec -T  mongorestore --archive --gzip &lt; dump.gz
function getNumberToLeftSide(numberToLeft) {
let numbr = ''
let i = 1;
while (!isNaN(numberToLeft[numberToLeft.length - i])) {
numbr = numberToLeft[numberToLeft.length - i] + numbr
i++;
}
return numbr
}