Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var parsedJSON = require('./employeesTest.json');
- var express = require("express");
- var app = express();
- var http = require('http');
- var massive = require("massive");
- var connectionString = "postgres://:@localhost/tl";
- var db = massive.connectSync({ connectionString: connectionString });
- var insert = function(err, res) {
- for (i = 0; i < parsedJSON.data.length; i++) {
- db.saveDoc("employees", parsedJSON.data[i]);
- if (err) {
- console.log('error: ', err);
- process.exit(1);
- };
- };
- };
- {
- "data": [{
- "id": 89304,
- "userName": "keith1@keith.keith"
- },
- {
- "id": 87431,
- "userName": null
- },
- {
- "id": 84863,
- "userName": null
- },
- {
- "id": 72371,
- "userName": "toad@toad.com"
- }
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement