Skip to content

The human way to mongodump and mongorestore your MongoDB Atlas cluster

License

Notifications You must be signed in to change notification settings

lukebellamy053/mongodb-cli

 
 

Repository files navigation

MongoDB Atlas Backup npm version

CircleCI

The easy way to restore and dump from mongodb databases

Install

npm install --save mongodb-cli

Setup & Use

import MongoHandler from 'mongodb-cli'

// Create an instance of the database connection
const process = new MongoHandler({
    ssl?: boolean; // Should the connection use SSL?
    auth?: {user: string, password: string, auth_db?: string} // The authentication information
    host?: string | {repl_set: string, nodes: Array<string>}; // A host DSN or connection object
    database?: string; // The database to backup / restore
    output_dir?: string; // Where should the backup be saved to
    input_dir?: string; // The directory to restore from
})

// Dump your cluster
await backup.dumpDatabase()

// Restore data to your cluster
await backup.restoreDatabase()

Information

This project is forked from kysely/mongodb-atlas-backup however the underlying code has been changed to use typescript and to allow for more flexibility with the configurations.

About

The human way to mongodump and mongorestore your MongoDB Atlas cluster

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 82.9%
  • JavaScript 17.1%