cgserver 10.1.1 → 10.1.2
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.
|
@@ -156,7 +156,7 @@ class MongoExt {
|
|
|
156
156
|
try {
|
|
157
157
|
let where = this._convertWhere({ _id: key });
|
|
158
158
|
let rs = await Core_1.core.safeCall(col.findOneAndUpdate, col, where, { $inc: { id: 1 } }, { upsert: true });
|
|
159
|
-
if (rs.id) {
|
|
159
|
+
if (rs && rs.id) {
|
|
160
160
|
return rs.id + 1;
|
|
161
161
|
}
|
|
162
162
|
return 1;
|