cgserver 13.2.11 → 13.2.13
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.
|
@@ -148,7 +148,11 @@ class MongoBaseService {
|
|
|
148
148
|
}
|
|
149
149
|
exports.MongoBaseService = MongoBaseService;
|
|
150
150
|
const autoIdSchema = new mongoose_1.Schema({
|
|
151
|
+
_id: { type: String, index: { unique: true } },
|
|
151
152
|
autoid: { type: Number, required: true, default: 0 }
|
|
153
|
+
}, { id: false });
|
|
154
|
+
autoIdSchema.virtual('id').get(function () {
|
|
155
|
+
return this._id;
|
|
152
156
|
});
|
|
153
157
|
class MongoAutoIdsService extends MongoBaseService {
|
|
154
158
|
constructor() {
|
|
@@ -45,7 +45,7 @@ const ini_1 = require("./ini");
|
|
|
45
45
|
class MongoUserService extends MongoBaseService_1.MongoBaseService {
|
|
46
46
|
constructor(extuserdef) {
|
|
47
47
|
const userSchema = new mongoose_1.default.Schema({ ...{
|
|
48
|
-
_id: { type: Number },
|
|
48
|
+
_id: { type: Number, index: { unique: true } },
|
|
49
49
|
account_id: { type: String, index: { unique: true } },
|
|
50
50
|
state: { type: Number, default: ini_1.EUserState.Normal },
|
|
51
51
|
is_robot: { type: Boolean, default: false },
|