fix:fightlog添加ttl

This commit is contained in:
xichaoyin 2024-01-09 22:23:42 +08:00
parent 0d736e4854
commit 666b7e51c5
2 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
import {fightResult} from '../shared/fightControl/fightType'; import {fightResult} from '../shared/fightControl/fightType';
export type CollectionFightLog = fightResult & { uid: string, type: string }; export type CollectionFightLog = fightResult & { uid: string, type: string, ttl: Date};

View File

@ -137,7 +137,7 @@ export class FightFun {
let writeList = ['ganhai', 'jjc', 'hbzbJfs', 'hbzbZbs', 'slzd', 'clsl'] let writeList = ['ganhai', 'jjc', 'hbzbJfs', 'hbzbZbs', 'slzd', 'clsl']
if (uid.indexOf('npc') != -1 || !writeList.includes(type)) return; if (uid.indexOf('npc') != -1 || !writeList.includes(type)) return;
G.mongodb.collection('fightLog').insertOne({ uid, type, ...result }) G.mongodb.collection('fightLog').insertOne({ uid, type, ...result, ttl: new Date() })
} }