@cocreate/mongodb 1.1.12 → 1.1.14

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.14](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.1.13...v1.1.14) (2023-01-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * docs sanbox overflow ([37501db](https://github.com/CoCreate-app/CoCreate-mongodb/commit/37501db7bbf759aa05bf3f75624b32eb79e3f559))
7
+
8
+ ## [1.1.13](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.1.12...v1.1.13) (2022-12-31)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * bump dependencies ([c2b1cc9](https://github.com/CoCreate-app/CoCreate-mongodb/commit/c2b1cc91837cb39607bb5959cb6e097f3e66c285))
14
+ * if name _id and !value continue ([ec6593e](https://github.com/CoCreate-app/CoCreate-mongodb/commit/ec6593eac6af348f29dc799b55d4af103d91b99a))
15
+
1
16
  ## [1.1.12](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.1.11...v1.1.12) (2022-12-30)
2
17
 
3
18
 
package/docs/index.html CHANGED
@@ -64,14 +64,14 @@
64
64
  <h2 class="border-bottom:1px_solid_lightgrey padding:5px_0px">Demo</h2>
65
65
  <div class="position:sticky top:0 padding:10px_0px height:100vh">
66
66
  <!-- SandBox -->
67
- <div class="position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px" id="playground">
67
+ <div class="display:flex flex-direction:column position:relative overflow:hidden card border-radius:2px width:auto height:600px margin-top:20px" id="playground">
68
68
 
69
69
  <div id="demo-code" resizable class="position:relative height:50%">
70
70
  <textarea type="code" lang="html" collection="demos" document_id="" name="demo" save="false" id="demo" class="height:100% width:100% outline:none border:none resize:none padding:5px"></textarea>
71
71
  <div resize="bottom" class="background:lightgrey"></div>
72
72
  </div>
73
73
 
74
- <div id="demo-preview" class="position:relative display:flex height:100% background-color:white">
74
+ <div id="demo-preview" class="position:relative overflow:auto background-color:white">
75
75
  <div get-value="#demo" class="padding:20px"></div>
76
76
  </div>
77
77
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/mongodb",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
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.2",
64
+ "@cocreate/hosting": "^1.7.2",
65
+ "@cocreate/utils": "^1.17.13",
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" })