yodata 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +6 -6
- package/data/plugin.js +6 -4
- package/package.json +1 -1
package/README.md
CHANGED
@@ -53,7 +53,7 @@ For Server Plan 500 Array max in same time
|
|
53
53
|
```js
|
54
54
|
let options = {
|
55
55
|
$gte: {money: 10}, // Get Users have money low of 10
|
56
|
-
$gt: {money: 50} // get Users have money more of 50
|
56
|
+
$gt: {money: 50}, // get Users have money more of 50
|
57
57
|
$in: {_id: ['123', '1234']} // get Users have in same _id
|
58
58
|
}
|
59
59
|
|
@@ -73,7 +73,7 @@ let data = await customersDB.findOne(options).select({money: 0}).exec(); // (Wil
|
|
73
73
|
```js
|
74
74
|
let options = {
|
75
75
|
$gte: {money: 10}, // Get Users have money low of 10
|
76
|
-
$gt: {money: 50} // get Users have money more of 50
|
76
|
+
$gt: {money: 50}, // get Users have money more of 50
|
77
77
|
$in: {_id: ['123', '1234']} // get Users have in same _id
|
78
78
|
}
|
79
79
|
|
@@ -96,7 +96,7 @@ let data = await customersDB.updateMany(options, new_values); // example output
|
|
96
96
|
```js
|
97
97
|
let options = {
|
98
98
|
$gte: {money: 10}, // Get Users have money low of 10
|
99
|
-
$gt: {money: 50} // get Users have money more of 50
|
99
|
+
$gt: {money: 50}, // get Users have money more of 50
|
100
100
|
$in: {_id: ['123', '1234']} // get Users have in same _id
|
101
101
|
}
|
102
102
|
|
@@ -109,13 +109,13 @@ let data = await customersDB.deleteMany(options); // example output → 'true/fa
|
|
109
109
|
```js
|
110
110
|
let options = {
|
111
111
|
$gte: {money: 10}, // Get Users have money low of 10
|
112
|
-
$gt: {money: 50} // get Users have money more of 50
|
112
|
+
$gt: {money: 50}, // get Users have money more of 50
|
113
113
|
$in: {_id: ['123', '1234']} // get Users have in same _id
|
114
114
|
}
|
115
115
|
|
116
|
-
let data = await customersDB.countDocuments(options) // example output →
|
116
|
+
let data = await customersDB.countDocuments(options) // example output → 50
|
117
117
|
|
118
|
-
let data = await customersDB.getSize(options); // example output →
|
118
|
+
let data = await customersDB.getSize(options); // example output → 177 (KB)
|
119
119
|
```
|
120
120
|
|
121
121
|
## Watch
|
package/data/plugin.js
CHANGED
@@ -6,13 +6,15 @@ let EventEmitter = require("events");
|
|
6
6
|
let collection = require('../data/collection.js')
|
7
7
|
|
8
8
|
class Plugin extends EventEmitter {
|
9
|
-
constructor (dataBaseID) {
|
10
|
-
super (dataBaseID)
|
9
|
+
constructor (dataBaseID, options = {}) {
|
10
|
+
super (dataBaseID, options = {})
|
11
11
|
|
12
12
|
this.dataBaseID = dataBaseID
|
13
13
|
this.project = new ws(`wss://y0data.glitch.me/?database_id=${this.dataBaseID}`)
|
14
|
-
|
15
|
-
|
14
|
+
|
15
|
+
if(!options.nameProcess) options.nameProcess = "plugin"
|
16
|
+
|
17
|
+
process[options.nameProcess] = this
|
16
18
|
|
17
19
|
}
|
18
20
|
|