-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathexample.js
44 lines (38 loc) · 1.04 KB
/
example.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const exportRoutine = require('./lib/export');
const importRoutine = require('./lib/import');
const countRoutine = require('./lib/count');
const importOpts = {
host: 'localhost',
db: 'dbclone-dev',
dataDir: 'dbclone-dev-20180622',
exclude: ['config', 'private']
};
const exportOpts = {
host: 'localhost',
db: 'dbclone-dev',
dataDir: 'dbclone-dev-20181024',
exclude: ['files', 'sessions']
};
const countOpts = {
host: 'localhost',
db: 'dbclone-dev',
collections: ['pages', 'configs', 'prod']
};
importRoutine(importOpts, (importErr, importData) => {
if (importErr) {
console.error('Import Error:', importErr);
}
console.log('Import Data:', importData);
exportRoutine(exportOpts, (exportErr, exportData) => {
if (exportErr) {
console.error('Export Error:', exportErr);
}
console.log('Export Data:', exportData);
countRoutine(countOpts, (countErr, countData) => {
if (countErr) {
console.error('Count Error:', countErr);
}
console.log('Count Data:', countData);
});
});
});