@cocreate/mongodb 1.1.11 → 1.1.13

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.1.13](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.1.12...v1.1.13) (2022-12-31)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * bump dependencies ([c2b1cc9](https://github.com/CoCreate-app/CoCreate-mongodb/commit/c2b1cc91837cb39607bb5959cb6e097f3e66c285))
7
+ * if name _id and !value continue ([ec6593e](https://github.com/CoCreate-app/CoCreate-mongodb/commit/ec6593eac6af348f29dc799b55d4af103d91b99a))
8
+
9
+ ## [1.1.12](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.1.11...v1.1.12) (2022-12-30)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * update config sources to use template braces with entry on src ([d2ca0fe](https://github.com/CoCreate-app/CoCreate-mongodb/commit/d2ca0fe5885af2b8e03d2c704e102ec55f847502))
15
+
1
16
  ## [1.1.11](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.1.10...v1.1.11) (2022-12-29)
2
17
 
3
18
 
@@ -6,13 +6,12 @@ module.exports = {
6
6
  },
7
7
 
8
8
  "sources": [{
9
- "entry": "./docs/index.html",
10
9
  "collection": "files",
11
10
  "document": {
12
11
  "_id": "60145dc49f64ba1680b86693",
13
12
  "name": "index.html",
14
13
  "path": "/docs/mongodb/index.html",
15
- "src": "{{source}}",
14
+ "src": "{{./docs/index.html}}",
16
15
  "domains": [
17
16
  "cocreate.app",
18
17
  "general.cocreate.app"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/mongodb",
3
- "version": "1.1.11",
3
+ "version": "1.1.13",
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",
@@ -60,9 +60,9 @@
60
60
  "webpack-log": "^3.0.1"
61
61
  },
62
62
  "dependencies": {
63
- "@cocreate/docs": "^1.4.27",
64
- "@cocreate/hosting": "^1.6.28",
65
- "@cocreate/utils": "^1.17.9",
63
+ "@cocreate/docs": "^1.5.1",
64
+ "@cocreate/hosting": "^1.7.1",
65
+ "@cocreate/utils": "^1.17.12",
66
66
  "mongodb": "^4.12.1"
67
67
  }
68
68
  }
package/src/index.js CHANGED
@@ -640,18 +640,24 @@ function getFilters(data) {
640
640
  function createQuery(filters) {
641
641
  let query = new Object();
642
642
 
643
- filters.forEach((item) => {
644
- if (!item.name) {
645
- return;
643
+
644
+ for (let item of filters) {
645
+
646
+ if (!item.name)
647
+ continue
648
+
649
+ if (item.name == "_id") {
650
+ if (item.value)
651
+ item.value = ObjectId(item.value)
652
+ else
653
+ continue
646
654
  }
647
- var key = item.name;
655
+
656
+ let key = item.name;
648
657
  if (!query[key]) {
649
658
  query[key] = {};
650
659
  }
651
-
652
- if (item.name == "_id")
653
- item.value = ObjectId(item.value)
654
-
660
+
655
661
  switch (item.operator) {
656
662
  case '$includes':
657
663
  case 'includes':
@@ -703,7 +709,7 @@ function createQuery(filters) {
703
709
  }
704
710
  break;
705
711
  }
706
- })
712
+ }
707
713
 
708
714
  //. global search
709
715
  //. we have to set indexes in text fields ex: db.chart.createIndex({ "$**": "text" })