@paralect/hive 0.1.24 → 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
|
@@ -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.
|
|
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.
|
|
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
|
})
|
|
@@ -68,6 +68,9 @@ export default async () => {
|
|
|
68
68
|
{ [`${fieldName}._id`]: entity._id },
|
|
69
69
|
{
|
|
70
70
|
$set: { [`${fieldName}.$`]: entity },
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
multi: true,
|
|
71
74
|
}
|
|
72
75
|
);
|
|
73
76
|
} else {
|
|
@@ -75,6 +78,9 @@ export default async () => {
|
|
|
75
78
|
{ [`${fieldName}._id`]: entity._id },
|
|
76
79
|
{
|
|
77
80
|
$set: { [`${fieldName}`]: entity },
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
multi: true,
|
|
78
84
|
}
|
|
79
85
|
);
|
|
80
86
|
}
|