@cocreate/mongodb 1.15.0 → 1.16.0

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,11 @@
1
+ # [1.16.0](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.15.0...v1.16.0) (2024-01-08)
2
+
3
+
4
+ ### Features
5
+
6
+ * bumped CoCreate dependencies to their latest versions ([6cbffba](https://github.com/CoCreate-app/CoCreate-mongodb/commit/6cbffba8c2a1582e770d213ec509a6f35be4b9b6))
7
+ * support $elemMatch operator ([520cda3](https://github.com/CoCreate-app/CoCreate-mongodb/commit/520cda3080816d487d0bc2e02c58996392f33a3b))
8
+
1
9
  # [1.15.0](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.14.0...v1.15.0) (2023-11-25)
2
10
 
3
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/mongodb",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
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",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "main": "./src/index.js",
47
47
  "dependencies": {
48
- "@cocreate/utils": "^1.29.0",
48
+ "@cocreate/utils": "^1.30.0",
49
49
  "mongodb": "^4.12.1"
50
50
  }
51
51
  }
package/src/index.js CHANGED
@@ -709,6 +709,15 @@ function createQuery(queries) {
709
709
  else
710
710
  query[key] = { $nin: item.value }
711
711
  break;
712
+ case '$elemMatch':
713
+ query[key] = {
714
+ "$elemMatch": {
715
+ name: {
716
+ $in: item.value
717
+ }
718
+ }
719
+ }
720
+ break;
712
721
  case '$or':
713
722
  if (!query[item.operator])
714
723
  query[item.operator] = [{ [key]: item.value }];
@@ -728,6 +737,9 @@ function createQuery(queries) {
728
737
  console.log('geowithin error');
729
738
  }
730
739
  break;
740
+ case 'dotNotation':
741
+ // TODO: handle CoCreate query using dotNotation, objects and utils.dotNotionToObject to perform deep merge
742
+ break;
731
743
  }
732
744
  }
733
745