@paralect/hive 0.1.25 → 0.1.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paralect/hive",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -104,22 +104,28 @@ const addOnDependentEntitiesUpdatedHandlers = ({ schemaName }) => {
104
104
  ifUpdated(dependentFields, async ({ doc }) => {
105
105
  const toUpdate = _.pick(doc, ["_id", ...dependentFields]);
106
106
  if (schema.shape[dependentFieldName] instanceof ZodArray) {
107
- db.services[schemaName].atomic.updateOne(
107
+ db.services[schemaName].atomic.update(
108
108
  { [`${dependentFieldName}._id`]: doc._id },
109
109
  {
110
110
  $set: {
111
111
  [`${dependentFieldName}.$`]: toUpdate,
112
112
  },
113
113
  },
114
+ {
115
+ multi: true,
116
+ }
114
117
  );
115
118
  } else {
116
- db.services[schemaName].atomic.updateOne(
119
+ db.services[schemaName].atomic.update(
117
120
  { [`${dependentFieldName}._id`]: doc._id },
118
121
  {
119
122
  $set: {
120
123
  [`${dependentFieldName}`]: toUpdate,
121
124
  },
122
125
  },
126
+ {
127
+ multi: true,
128
+ }
123
129
  );
124
130
  }
125
131
  })