-
Notifications
You must be signed in to change notification settings - Fork 0
/
adduser.js
executable file
·72 lines (56 loc) · 1.48 KB
/
adduser.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//==============================================================================
/*
* Author: Krushn Dayshmookh
*
var MongoClient = require('mongodb').MongoClient;
var mongolaburi = "mongodb://clavi:[email protected]:17592/clavi";
/*
var users = [{
id: "2016ACSC0108072",
name: "Krushn Dayshmookh",
type: "students",
email: "[email protected]",
password: "2016ACSC0108072"
},
{
id: "2016ACSC0101067",
name: "Mrunalini Dudhagawali",
type: "students",
email: "[email protected]",
password: "2016ACSC0101067"
},
{
id: "samplestudent",
name: "Eclair",
type: "students",
email: "[email protected]",
password: "samplestudentpassword"
},
{
id: "sampleteacher",
name: "Octopus",
type: "teachers",
email: "[email protected]",
password: "sampleteacherpassword"
},
{
id: "octocat",
name: "Master Octocat",
type: "admins",
email: "superduperemailyoudontknow",
password: "octocatpassword"
}
];
*
//console.log(someusers);
// Connection URL
var url = mongolaburi;
MongoClient.connect(url, function (err, db) {
if (err) throw err;
db.collection("users").insert(users, function (err1, res) {
if (err1) throw err1;
console.log("Number of records inserted: " + res.insertedCount);
db.close();
});
});
*/