cgserver 6.1.7 → 6.1.10

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,8 +292,21 @@ 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
- up_rs = await col.updateOne(where, model, { upsert: upsert });
309
+ up_rs = await col.updateOne(where, updatemodel, { upsert: upsert });
297
310
  }
298
311
  catch (e) {
299
312
  Log_1.GLog.error(e.stack);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cgserver",
3
- "version": "6.1.7",
3
+ "version": "6.1.10",
4
4
  "author": "trojan",
5
5
  "type": "commonjs",
6
6
  "description": "free for all.Websocket or Http",