cgserver 8.6.6 → 8.6.7
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/README.md
CHANGED
|
@@ -116,13 +116,10 @@ class MongoManager {
|
|
|
116
116
|
try {
|
|
117
117
|
let where = this._convertWhere({ _id: key });
|
|
118
118
|
let rs = await Core_1.core.safeCall(col.findOneAndUpdate, col, where, { $inc: { id: 1 } }, { upsert: true });
|
|
119
|
-
if (rs.
|
|
120
|
-
|
|
121
|
-
return rs.value.id + 1;
|
|
122
|
-
}
|
|
123
|
-
return 0 + 1;
|
|
119
|
+
if (rs.id) {
|
|
120
|
+
return rs.id + 1;
|
|
124
121
|
}
|
|
125
|
-
return
|
|
122
|
+
return 1;
|
|
126
123
|
}
|
|
127
124
|
catch (e) {
|
|
128
125
|
Log_1.GLog.error(e.stack);
|