cgserver 6.1.5 → 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.
|
@@ -100,7 +100,7 @@ class MongoManager {
|
|
|
100
100
|
return 0 + 1;
|
|
101
101
|
}
|
|
102
102
|
catch (e) {
|
|
103
|
-
Log_1.GLog.error(e);
|
|
103
|
+
Log_1.GLog.error(e.stack);
|
|
104
104
|
}
|
|
105
105
|
return -1;
|
|
106
106
|
}
|
|
@@ -141,7 +141,7 @@ class MongoManager {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
catch (e) {
|
|
144
|
-
Log_1.GLog.error(e);
|
|
144
|
+
Log_1.GLog.error(e.stack);
|
|
145
145
|
rs.errcode = _error_1.EErrorCode.Mongo_Error;
|
|
146
146
|
}
|
|
147
147
|
rs.one = one;
|
|
@@ -170,7 +170,7 @@ class MongoManager {
|
|
|
170
170
|
list = await cursor.toArray();
|
|
171
171
|
}
|
|
172
172
|
catch (e) {
|
|
173
|
-
Log_1.GLog.error(e);
|
|
173
|
+
Log_1.GLog.error(e.stack);
|
|
174
174
|
rs.errcode = _error_1.EErrorCode.Mongo_Error;
|
|
175
175
|
}
|
|
176
176
|
rs.list = list;
|
|
@@ -189,7 +189,7 @@ class MongoManager {
|
|
|
189
189
|
count = await col.countDocuments(where || {}, options);
|
|
190
190
|
}
|
|
191
191
|
catch (e) {
|
|
192
|
-
Log_1.GLog.error(e);
|
|
192
|
+
Log_1.GLog.error(e.stack);
|
|
193
193
|
rs.errcode = _error_1.EErrorCode.Mongo_Error;
|
|
194
194
|
}
|
|
195
195
|
rs.count = count;
|
|
@@ -208,7 +208,7 @@ class MongoManager {
|
|
|
208
208
|
del_rs = await col.deleteOne(where || {});
|
|
209
209
|
}
|
|
210
210
|
catch (e) {
|
|
211
|
-
Log_1.GLog.error(e);
|
|
211
|
+
Log_1.GLog.error(e.stack);
|
|
212
212
|
rs.errcode = _error_1.EErrorCode.Mongo_Error;
|
|
213
213
|
}
|
|
214
214
|
if (del_rs) {
|
|
@@ -229,7 +229,7 @@ class MongoManager {
|
|
|
229
229
|
del_rs = await col.deleteMany(where || {});
|
|
230
230
|
}
|
|
231
231
|
catch (e) {
|
|
232
|
-
Log_1.GLog.error(e);
|
|
232
|
+
Log_1.GLog.error(e.stack);
|
|
233
233
|
rs.errcode = _error_1.EErrorCode.Mongo_Error;
|
|
234
234
|
}
|
|
235
235
|
if (del_rs) {
|
|
@@ -254,7 +254,7 @@ class MongoManager {
|
|
|
254
254
|
in_rs = await col.insertOne(data);
|
|
255
255
|
}
|
|
256
256
|
catch (e) {
|
|
257
|
-
Log_1.GLog.error(e);
|
|
257
|
+
Log_1.GLog.error(e.stack);
|
|
258
258
|
rs.errcode = _error_1.EErrorCode.Mongo_Error;
|
|
259
259
|
}
|
|
260
260
|
rs.rs = in_rs;
|
|
@@ -272,7 +272,7 @@ class MongoManager {
|
|
|
272
272
|
in_rs = await col.insertMany(data);
|
|
273
273
|
}
|
|
274
274
|
catch (e) {
|
|
275
|
-
Log_1.GLog.error(e);
|
|
275
|
+
Log_1.GLog.error(e.stack);
|
|
276
276
|
rs.errcode = _error_1.EErrorCode.Mongo_Error;
|
|
277
277
|
}
|
|
278
278
|
rs.rs = in_rs;
|
|
@@ -292,19 +292,24 @@ class MongoManager {
|
|
|
292
292
|
}
|
|
293
293
|
let up_rs = null;
|
|
294
294
|
try {
|
|
295
|
-
let
|
|
296
|
-
let
|
|
297
|
-
|
|
298
|
-
|
|
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 };
|
|
299
304
|
}
|
|
300
305
|
else {
|
|
301
|
-
|
|
306
|
+
updatemodel = model;
|
|
302
307
|
}
|
|
303
308
|
let col = this._mongo.collection(collection);
|
|
304
|
-
up_rs = await col.updateOne(where,
|
|
309
|
+
up_rs = await col.updateOne(where, model, { upsert: upsert });
|
|
305
310
|
}
|
|
306
311
|
catch (e) {
|
|
307
|
-
Log_1.GLog.error(e);
|
|
312
|
+
Log_1.GLog.error(e.stack);
|
|
308
313
|
rs.errcode = _error_1.EErrorCode.Mongo_Error;
|
|
309
314
|
}
|
|
310
315
|
rs.rs = up_rs;
|
|
@@ -334,7 +339,7 @@ class MongoManager {
|
|
|
334
339
|
up_rs = await col.updateMany(where, updateModel, { upsert: upsert });
|
|
335
340
|
}
|
|
336
341
|
catch (e) {
|
|
337
|
-
Log_1.GLog.error(e);
|
|
342
|
+
Log_1.GLog.error(e.stack);
|
|
338
343
|
rs.errcode = _error_1.EErrorCode.Mongo_Error;
|
|
339
344
|
}
|
|
340
345
|
rs.rs = up_rs;
|
|
@@ -352,7 +357,7 @@ class MongoManager {
|
|
|
352
357
|
i_rs = await col.createIndex(index, callback);
|
|
353
358
|
}
|
|
354
359
|
catch (e) {
|
|
355
|
-
Log_1.GLog.error(e);
|
|
360
|
+
Log_1.GLog.error(e.stack);
|
|
356
361
|
rs.errcode = _error_1.EErrorCode.Mongo_Error;
|
|
357
362
|
}
|
|
358
363
|
rs.rs = i_rs;
|
|
@@ -383,7 +388,7 @@ class MongoManager {
|
|
|
383
388
|
}
|
|
384
389
|
}
|
|
385
390
|
catch (e) {
|
|
386
|
-
Log_1.GLog.error(e);
|
|
391
|
+
Log_1.GLog.error(e.stack);
|
|
387
392
|
rs.errcode = _error_1.EErrorCode.Mongo_Error;
|
|
388
393
|
}
|
|
389
394
|
rs.list = list;
|