-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
65 lines (58 loc) · 1.67 KB
/
main.js
File metadata and controls
65 lines (58 loc) · 1.67 KB
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
var async = require("async");
var DatabaseObject = require('./dbObject/DatabaseObject');
var db = new DatabaseObject();
var model = db.userModel("Intelligrape");
var address = function (uHouseNo, uSector, uCity, uState, uPin) {
return{
houseNo: uHouseNo,
sector: uSector,
city: uCity,
state: uState,
pin: uPin
};
};
var condition = function (uValue) {
return{
name: uValue
};
};
var update = function (uValue) {
return{
mobile: uValue
};
};
async.series([function (callback) {
db.createNewUser("sandeep kumar", 25, 'male', '9555082881', address('g138', 22, 'noida', 'UP', 201301), 'Ninja', 10000, model);
callback();
},
function (callback) {
db.selectAllRecords(model);
callback();
},
function (callback) {
db.updateRecord(condition('sandeep kumar'), update('9632587412'), model);
callback();
},
function (callback) {
db.selectAllRecords(model);
callback();
},
function (callback) {
db.removeRecord(condition('sandeep kumar'), model);
callback();
},
function (callback) {
db.selectAllRecords(model);
callback();
}
],
function (err, results) {
// results is now equal to: {one: 1, two: 2}
}
);
/*
db.createNewUser("sandeep kumar", 25, 'male', '9555082881', address('g138', 22, 'noida', 'UP', 201301), 'Ninja', 10000, model);
db.updateRecord(condition('sandeep kumar'), update('9632587412'), model)
db.removeRecord(condition('sandeep kumar'), model);
db.selectAllRecords(model);
*/