@dnax/core 0.73.1 → 0.73.3

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.
@@ -1653,6 +1653,11 @@ class useRest {
1653
1653
  },
1654
1654
  $setOnInsert: {
1655
1655
  createdAt: new Date(),
1656
+ ...formatData(update?.$setOnInsert || {}, {
1657
+ collection: collection,
1658
+ tenant_id: this.#tenant_id,
1659
+ action: "updateMany",
1660
+ }),
1656
1661
  },
1657
1662
  },
1658
1663
  {
@@ -1812,6 +1817,7 @@ class useRest {
1812
1817
  ...formatData(update?.$setOnInsert || {}, {
1813
1818
  collection: collection,
1814
1819
  tenant_id: this.#tenant_id,
1820
+ action: "insertOne",
1815
1821
  }),
1816
1822
  //updatedAt: new Date(),
1817
1823
  createdAt: new Date(),
package/lib/collection.ts CHANGED
@@ -66,8 +66,40 @@ async function syncCollectionDatabase() {
66
66
  ?.listCollections()
67
67
  .toArray();
68
68
 
69
- //t.database.db.
69
+ // System collections
70
+ t.database.db
71
+ ?.collection("_etl_")
72
+ .createIndex({
73
+ createdAt: -1,
74
+ updatedAt: -1,
75
+ })
76
+ .catch();
70
77
 
78
+ t.database.db
79
+ ?.collection("_activity_")
80
+ .createIndex({
81
+ createdAt: -1,
82
+ updatedAt: -1,
83
+ })
84
+ .catch();
85
+
86
+ t.database.db
87
+ ?.collection("_activity_")
88
+ .createIndex({
89
+ "operation.type": 1,
90
+ })
91
+ .catch();
92
+
93
+ t.database.db
94
+ ?.collection("_activity_")
95
+ .createIndex({
96
+ "operation.target": 1,
97
+ })
98
+ .catch();
99
+
100
+ //__________
101
+
102
+ // local Collections
71
103
  if (t.database.driver == "mongodb") {
72
104
  const collections: (Collection & TimeSeriesCollection[]) | undefined =
73
105
  Cfg.collections?.filter((cn) => cn.tenant_id == t.id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dnax/core",
3
- "version": "0.73.1",
3
+ "version": "0.73.3",
4
4
  "module": "index.ts",
5
5
  "type": "module",
6
6
  "bin": {},