@cocreate/mongodb 1.0.4 → 1.0.6

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,18 @@
1
+ ## [1.0.6](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.0.5...v1.0.6) (2022-12-08)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * console.log ObjectId ([4ae33fd](https://github.com/CoCreate-app/CoCreate-mongodb/commit/4ae33fdf77cbd5486fcef1b1088f430ff3a80efe))
7
+ * test ObjectId ([cbe0b20](https://github.com/CoCreate-app/CoCreate-mongodb/commit/cbe0b20304c2cb34a4feef7e0586148e171cab26))
8
+
9
+ ## [1.0.5](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.0.4...v1.0.5) (2022-12-08)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * update mongodb dependency ([1745139](https://github.com/CoCreate-app/CoCreate-mongodb/commit/1745139844c0d300939fd2cfc9b7f0a2e3c38b14))
15
+
1
16
  ## [1.0.4](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.0.3...v1.0.4) (2022-12-07)
2
17
 
3
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/mongodb",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "A simple mongodb component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "mongodb",
@@ -64,6 +64,6 @@
64
64
  "@cocreate/docs": "^1.4.13",
65
65
  "@cocreate/hosting": "^1.6.12",
66
66
  "@cocreate/utils": "^1.14.2",
67
- "mongodb": "^4.4.0"
67
+ "mongodb": "^4.12.1"
68
68
  }
69
69
  }
package/src/index.js CHANGED
@@ -324,9 +324,9 @@ function document(action, data){
324
324
  data[type][i]._id = ObjectId(data[type][i]._id)
325
325
  data[type][i]['created'] = {on: data.timeStamp, by: data.user_id || data.clientId}
326
326
  }
327
- if (action == 'readDocument') {
328
- if (data[type][i]._id)
329
- _ids.push(ObjectId(data[type][i]._id))
327
+ if (action == 'readDocument' && data[type][i]._id) {
328
+ console.log('mongodb: ', data[type][i]._id)
329
+ _ids.push(ObjectId(data[type][i]._id))
330
330
  }
331
331
  if (action =='updateDocument') {
332
332
  if (data[type][i]._id)