1.0.0 • Published 3 years ago

node-mongo-dump v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
3 years ago

node-mongo-dump

version 1 🚀

Menu

This library is really simple. It's allows you to backup your Mongodb on a specific frequency using mongodump.

💻 NPM commands

Install the library npm i node-mongo-dump

Declare the function in the js file that start your server

const nodeMongo = require('node-mongo-dump');

nodeMongo();

And then... That's it, you're Ready to go 🚀

📖 API

ArgumentstypeDefault ValueCommentary
frequencystring'0 0 * * *'How often you want to dump your database.
nbSavednumber14The number of dumps you want to keep. If you reach the nbSaved, it will delete the oldest before saving a new one.
hoststring'localhost'Your mongodb host.
portstring'27017'Your mongodb port.
outPathstring'./../../dumps/'The directory where you want to save the dumps.
dbNamestring'db'Your database name
withStdoutbooleanfalseVariable to log the output of mongodump command
withStderrbooleanfalseVariable to log the errors of mongodump command
withClosebooleanfalseVariable to log the ouendtput of mongodump command

📝 Notes & questions

⏰ TODO