-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
I use this library inside my nest.js service.
Collection folders get created but they are all empty.
This is my code:
`var backup = require('mongodb-backup');
import { Injectable, Logger } from "@nestjs/common";
@Injectable()
export class BackupDbService {
private readonly logger = new Logger(BackupDbService.name);
mongoUrl = 'mongodb://localhost:27017/admin';
backupDb() {
try {
backup({
uri: this.mongoUrl, // mongodb://<dbuser>:<dbpassword>@<dbdomain>.mongolab.com:<dbport>/<dbdatabase>
collections: ['rates'],
root: 'db',
callback: function(err) {
if (err) {
console.error(err);
} else {
console.log('finish');
}
}
});
} catch (err) {
this.logger.error(err);
}
}
} `
madarco, raphaelpreston, BrunoEleodoro, kapwebdr, waifutech and 2 more
Metadata
Metadata
Assignees
Labels
No labels