gateway schema

This commit is contained in:
2023-08-18 15:29:18 +00:00
parent ae22fc7c28
commit a37baa64fe
5 changed files with 95 additions and 8 deletions
+2 -2
View File
@@ -22,9 +22,9 @@ export const UserLog = new Schema<IUserLog>({
logDate: { type: Date, required: true },
logType: { type: String, required: true, enum: LogTypeList },
action: { type: Object, required: true },
})
}, { autoIndex: false })
.index({ userID: 1, logDate: 1 })
.index({ logDate: 1 })
.index({ logDate: 1 }, { expireAfterSeconds: 60 * 60 * 24 * 365 * 3 })
;
export default model<IUserLog>('UserLog', UserLog);