Created
July 12, 2017 14:07
-
-
Save lukasz-kaniowski/d3bb711eb6733f51a218559c3d2d73e4 to your computer and use it in GitHub Desktop.
Streaming backup of mongodb 3.2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const fs = require('fs') | |
| const writeStream = fs.createWriteStream('out.db') | |
| const { spawn } = require('child_process'); | |
| const mongodump = spawn('mongodump', ['--archive', '--db', 'databaseName']); | |
| mongodump.stdout.pipe(writeStream); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment