@cocreate/crud-server 1.14.0 → 1.14.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.14.2](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.14.1...v1.14.2) (2022-11-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * improved readDocument filter, bump dependencies ([df58e49](https://github.com/CoCreate-app/CoCreate-crud-server/commit/df58e499709723b44882e7ce67a934c20d833f30))
7
+
8
+ ## [1.14.1](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.14.0...v1.14.1) (2022-11-26)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * bump dependencies ([e1a6646](https://github.com/CoCreate-app/CoCreate-crud-server/commit/e1a66469d5be78ae19fdecbfabf5ada49c11a20a))
14
+
1
15
  # [1.14.0](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.13.7...v1.14.0) (2022-11-25)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/crud-server",
3
- "version": "1.14.0",
3
+ "version": "1.14.2",
4
4
  "description": "CoCreate-crud-server",
5
5
  "keywords": [
6
6
  "cocreate-crud",
@@ -40,8 +40,8 @@
40
40
  },
41
41
  "homepage": "https://cocreate.app/docs/CoCreate-crud-server",
42
42
  "dependencies": {
43
- "@cocreate/docs": "^1.4.4",
44
- "@cocreate/utils": "^1.12.0",
43
+ "@cocreate/docs": "^1.4.6",
44
+ "@cocreate/utils": "^1.12.1",
45
45
  "csvtojson": "^2.0.10",
46
46
  "json-2-csv": "^3.10.3",
47
47
  "mongodb": "^4.4.0"
@@ -384,13 +384,17 @@ function document(action, data){
384
384
  }
385
385
 
386
386
  if (result) {
387
- // ToDo: forEach at cursor, searchData can can be an object or an array to 1 or many docs
388
- let searchResult = searchData(result, data.filter)
389
- for (let doc of searchResult) {
390
- doc.db = 'mongodb'
391
- doc.database = database
392
- doc.collection = collection
393
- documents.push(doc)
387
+ // ToDo: forEach at cursor
388
+ for (let doc of result) {
389
+ let isFilter = true
390
+ if (data.filter['search'])
391
+ isFilter = searchData(doc, data.filter['search'])
392
+ if (isFilter) {
393
+ doc.db = 'mongodb'
394
+ doc.database = database
395
+ doc.collection = collection
396
+ documents.push(doc)
397
+ }
394
398
  }
395
399
 
396
400
  if (data.returnDocument == false) {