diff --git a/collection/opendb-verify-codes/collection.json b/collection/opendb-verify-codes/collection.json index d8d90de..e1db745 100644 --- a/collection/opendb-verify-codes/collection.json +++ b/collection/opendb-verify-codes/collection.json @@ -68,5 +68,17 @@ }], "MgoIsUnique": false } + }, { + "IndexName": "device_uuid_code_", + "MgoKeySchema": { + "MgoIndexKeys": [{ + "Name": "device_uuid", + "Direction": "1" + }, { + "Name": "code", + "Direction": "1" + }], + "MgoIsUnique": false + } }] } diff --git a/collection/uni-id-log/collection.json b/collection/uni-id-log/collection.json index 3ebc057..0917640 100644 --- a/collection/uni-id-log/collection.json +++ b/collection/uni-id-log/collection.json @@ -1,7 +1,7 @@ { "schema": { "bsonType": "object", - "required": ["user_id"], + "required": [], "properties": { "_id": { "description": "ID,系统自动生成" @@ -16,17 +16,20 @@ }, "device_uuid": { "bsonType": "string", - "description": "设备唯一标识(需要加密存储)" + "description": "设备唯一标识" }, "type": { "bsonType": "string", - "enum": ["login", "logout"], + "enum": [ + "login", + "logout" + ], "description": "登录类型" }, - "state": { - "bsonType": "int", - "description": "结果:0 失败、1 成功" - }, + "state": { + "bsonType": "int", + "description": "结果:0 失败、1 成功" + }, "ip": { "bsonType": "string", "description": "ip地址" @@ -40,5 +43,30 @@ } } }, - "index": [] -} + "index": [ + { + "IndexName": "user_id", + "MgoKeySchema": { + "MgoIndexKeys": [ + { + "Name": "user_id", + "Direction": "1" + } + ], + "MgoIsUnique": true + } + }, + { + "IndexName": "device_uuid", + "MgoKeySchema": { + "MgoIndexKeys": [ + { + "Name": "device_uuid", + "Direction": "1" + } + ], + "MgoIsUnique": true + } + } + ] +} \ No newline at end of file