Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import * as fs from 'fs';
- (async () => {
- const nano = require('nano')(`http://admin:password@127.0.0.1:5984`);
- const museumDatabase = nano.use('bailo')
- const COUCH_DB_FILE = '/Users/simonedare/Desktop/geisoft/json-examples/db2.json'
- const content = fs.readFileSync(COUCH_DB_FILE, 'utf-8')
- const backup = JSON.parse(content)
- const pushResult = await museumDatabase.bulk({
- docs: backup
- })
- console.log(pushResult)
- })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement