#!/usr/bin/env node require('dotenv').config({path: '../.env'}) const path = require('path') const pg = require('../db/pg') const newDB = require('../db') const oldDB = require('./mongo')('mongodb://localhost/sos') const saveOrderDatafile = require('./tasks/saveOrderDatafile') saveOrderDatafile(oldDB, path.join(__dirname, './users.json')) .catch(console.error) .finally(() => { pg.end() oldDB._connection.close() });