Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | import { Document, Schema } from 'mongoose'; import { IUserSession } from 'src/modules/domain/auth/user-session/shared/user-session.interface'; import { TableName } from '../../../shared/database.const'; import { convertObject } from '../../shared/mongo.utils'; export interface IUserSessionDocument extends IUserSession, Document {} export const UserSessionSchema = new Schema<IUserSessionDocument>( { userId: { type: String, required: true }, isDeleted: { type: Boolean, required: true, default: false }, deleteAt: { type: Date }, }, { collection: TableName.UserSession, timestamps: true, toJSON: { transform: (_, ret) => convertObject(ret), virtuals: true, }, toObject: { transform: (_, ret) => convertObject(ret), virtuals: true, }, }, ); |