The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/models/server/raw/EmailMessageHistory.ts

16 lines
530 B

import { IndexSpecification, InsertOneWriteOpResult, WithId } from 'mongodb';
import { BaseRaw } from './BaseRaw';
import { IEmailMessageHistory as T } from '../../../../definition/IEmailMessageHistory';
export class EmailMessageHistoryRaw extends BaseRaw<T> {
protected indexes: IndexSpecification[] = [{ key: { createdAt: 1 }, expireAfterSeconds: 60 * 60 * 24 }];
async create({ _id, email }: T): Promise<InsertOneWriteOpResult<WithId<T>>> {
return this.insertOne({
_id,
email,
createdAt: new Date(),
});
}
}