cgserver 6.1.7 → 6.1.8
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.
|
@@ -292,6 +292,19 @@ class MongoManager {
|
|
|
292
292
|
}
|
|
293
293
|
let up_rs = null;
|
|
294
294
|
try {
|
|
295
|
+
let updatemodel = null;
|
|
296
|
+
let money = false;
|
|
297
|
+
for (let key in model) {
|
|
298
|
+
if (key.startsWith("$")) {
|
|
299
|
+
money = true;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
if (money) {
|
|
303
|
+
updatemodel = { "$set": model };
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
updatemodel = model;
|
|
307
|
+
}
|
|
295
308
|
let col = this._mongo.collection(collection);
|
|
296
309
|
up_rs = await col.updateOne(where, model, { upsert: upsert });
|
|
297
310
|
}
|