@burakbey/mongodb-tools
v1.0.2
Published
This is a simple package that you can run `mongodump` and `mongorestore` commands on both `Linux` and `Windows` platforms.
Downloads
3
Readme
@burakbey/mongodb-tools
This is a simple package that you can run mongodump
and mongorestore
commands on both Linux
and Windows
platforms.
Usage
import { dump } from '@burakbey/mongodb-tools';
import { join } from 'path';
async function myFunction() {
const uri = 'mongodb://127.0.0.1/database';
const output = join(__dirname, 'dump');
const outputFolderName = await dump(uri, output);
console.log(`Done. ${join(output, outputFolderName)}`);
}
myFunction();