yodata 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 → 'true/false'
116
+ let data = await customersDB.countDocuments(options) // example output → 50
117
117
 
118
- let data = await customersDB.getSize(options); // example output → 'true/false' (if update one only will return true always)
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
- process.plugin = this
14
+
15
+ if(!options.nameProcess) options.nameProcess = "plugin"
16
+
17
+ process[options.nameProcess] = this
16
18
 
17
19
  }
18
20
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yodata",
3
3
  "description": "Y0data online services to save your data",
4
- "version": "0.0.3",
4
+ "version": "0.0.5",
5
5
  "main": "data/plugin.js",
6
6
  "dependencies": {
7
7
  "events": "^3.3.0",
package/ws/index.js CHANGED
@@ -39,9 +39,10 @@ this._connect(url, this.headers, options)
39
39
  _catchSystem(){
40
40
  setInterval(async ()=>{
41
41
  if(this.cache === true) return;
42
+
42
43
  this._messages = []
43
- for(const d of this.historyPing.filter(data => data.use === true)) this.historyPing.shift(d)
44
- for(const d of this.historySend.filter(data => data.use === true)) this.historySend.shift(d)
44
+ for(const d of this.historyPing.filter(data => data.use === true)) this.historyPing = this.historyPing.filter(x => x.id === d.id)
45
+ for(const d of this.historySend.filter(data => data.use === true)) this.historySend = this.historySend.filter(x => x.id === d.id)
45
46
 
46
47
  }, 500)
47
48
  }