@pi-r/atlas 0.2.1 → 0.2.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.
- package/client/index.js +11 -4
- package/package.json +7 -7
package/client/index.js
CHANGED
|
@@ -133,11 +133,14 @@ async function executeBatchQuery(credential, batch, sessionKey) {
|
|
|
133
133
|
}
|
|
134
134
|
if ((0, types_1.isArray)(update)) {
|
|
135
135
|
const insertOptions = item.execute?.insert;
|
|
136
|
-
if (insertOptions) {
|
|
137
|
-
|
|
136
|
+
if (insertOptions && coercing) {
|
|
137
|
+
(0, types_1.coerceObject)(insertOptions);
|
|
138
|
+
}
|
|
139
|
+
if (update.length === 1) {
|
|
140
|
+
await collection.insertOne(update[0], insertOptions);
|
|
138
141
|
}
|
|
139
142
|
else {
|
|
140
|
-
await collection.insertMany(update);
|
|
143
|
+
await collection.insertMany(update, insertOptions);
|
|
141
144
|
}
|
|
142
145
|
update = undefined;
|
|
143
146
|
}
|
|
@@ -150,7 +153,11 @@ async function executeBatchQuery(credential, batch, sessionKey) {
|
|
|
150
153
|
}
|
|
151
154
|
else {
|
|
152
155
|
if (update) {
|
|
153
|
-
|
|
156
|
+
const updateOptions = item.execute?.update;
|
|
157
|
+
if (updateOptions && coercing) {
|
|
158
|
+
(0, types_1.coerceObject)(updateOptions);
|
|
159
|
+
}
|
|
160
|
+
await collection.updateMany(filter, update, updateOptions);
|
|
154
161
|
}
|
|
155
162
|
const items = collection.find(filter, command);
|
|
156
163
|
if (sort) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pi-r/atlas",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "MongoDB Atlas cloud functions for E-mc.",
|
|
5
5
|
"main": "client/index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"homepage": "https://github.com/anpham6/pi-r#readme",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@e-mc/cloud": "^0.5.
|
|
24
|
-
"@e-mc/db": "^0.5.
|
|
25
|
-
"@e-mc/module": "^0.5.
|
|
26
|
-
"@e-mc/types": "^0.5.
|
|
27
|
-
"@pi-r/mongodb": "^0.2.
|
|
28
|
-
"mongodb": "^5.
|
|
23
|
+
"@e-mc/cloud": "^0.5.3",
|
|
24
|
+
"@e-mc/db": "^0.5.3",
|
|
25
|
+
"@e-mc/module": "^0.5.3",
|
|
26
|
+
"@e-mc/types": "^0.5.3",
|
|
27
|
+
"@pi-r/mongodb": "^0.2.3",
|
|
28
|
+
"mongodb": "^5.7.0"
|
|
29
29
|
}
|
|
30
30
|
}
|