-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·80 lines (63 loc) · 1.37 KB
/
index.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
73
74
75
76
77
78
79
80
"use strict";
let mongoDriver = require("devis");
let mongofunctions = require("./libs/functions");
mongoDriver.push({
role: "mongodb",
action: "connect"
}, mongofunctions.connect);
mongoDriver.push({
role: "mongodb",
action: "index"
}, mongofunctions.index);
mongoDriver.push({
role: "mongodb",
action: "close"
}, mongofunctions.close);
mongoDriver.push({
role: "mongodb",
action: "insert"
}, mongofunctions.insert);
mongoDriver.push({
role: "mongodb",
action: "find"
}, mongofunctions.find);
mongoDriver.push({
role: "mongodb",
action: "aggregate"
}, mongofunctions.aggregate);
mongoDriver.push({
role: "mongodb",
action: "update"
}, mongofunctions.update);
mongoDriver.push({
role: "mongodb",
action: "delete"
}, mongofunctions.del);
mongoDriver.push({
role: "mongodb",
action: "dropCollection"
}, mongofunctions.dropCollection);
mongoDriver.push({
role: "mongodb",
action: "createCollection"
}, mongofunctions.createCollection);
module.exports = mongoDriver;//for local use
//using protocoles
//unix socket:
/*
mongoDriver.listen({
path:"/tmp/mongodb.sock"
});
*/
//named pipes:
/*
mongoDriver.listen({path: "\\\\\.\\pipe\\mongodb"});
*/
//tcp:
/*
mongoDriver.listen({host: "127.0.0.1" port : 3030, type:"tcp"});
*/
//http:
/*
mongoDriver.listen({host: "127.0.0.1" port : 3030, type:"http"});
*/