@cocreate/crud-server 1.15.2 → 1.15.4

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.15.4](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.15.3...v1.15.4) (2022-12-04)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * opertor throwing a regex error ([6683f40](https://github.com/CoCreate-app/CoCreate-crud-server/commit/6683f4012353f81614a97ad997e622f985613f5a))
7
+
8
+ ## [1.15.3](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.15.2...v1.15.3) (2022-12-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * readDocument doc._id.toString() ([ab22fea](https://github.com/CoCreate-app/CoCreate-crud-server/commit/ab22fea26e94282190800f1c0484faadef9ffdb9))
14
+
1
15
  ## [1.15.2](https://github.com/CoCreate-app/CoCreate-crud-server/compare/v1.15.1...v1.15.2) (2022-12-04)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/crud-server",
3
- "version": "1.15.2",
3
+ "version": "1.15.4",
4
4
  "description": "CoCreate-crud-server",
5
5
  "keywords": [
6
6
  "cocreate-crud",
package/src/index.js CHANGED
@@ -98,8 +98,6 @@ class CoCreateCrudServer {
98
98
  data['organization_id'] = process.env.organization_id
99
99
  }
100
100
 
101
- console.log('crud-server-----', data['organization_id'], data.collection, data.database)
102
-
103
101
  if (!data.db || !data.db.length)
104
102
  data.db = this.dbs
105
103
  let dbsLength = data.db.length
@@ -405,6 +405,7 @@ function document(action, data){
405
405
  doc.db = 'mongodb'
406
406
  doc.database = database
407
407
  doc.collection = collection
408
+ doc._id = doc._id.toString()
408
409
  documents.push(doc)
409
410
  }
410
411
  }
@@ -701,12 +702,12 @@ function createQuery(filters) {
701
702
  query[key][item.operator] = item.value;
702
703
  break;
703
704
  case '$in':
704
- var in_values = [];
705
- item.value.forEach(function(v) {
706
- in_values.push(new RegExp(".*" + v + ".*", "i"));
707
- });
705
+ // var in_values = [];
706
+ // item.value.forEach(function(v) {
707
+ // in_values.push(new RegExp(".*" + v + ".*", "i"));
708
+ // });
708
709
 
709
- query[key] = {$in : in_values }
710
+ query[key] = {$in : item.value }
710
711
  break;
711
712
  case '$nin':
712
713
  query[key][item.operator] = item.value;