src/logbooks/schemas/message-content.schema.ts
Properties |
| body |
Type : string
|
Decorators :
@Prop()
|
| Optional info |
Type : Record<string | string>
|
Decorators :
@Prop(undefined)
|
| msgtype |
Type : string
|
Decorators :
@Prop()
|
| Optional url |
Type : string
|
Decorators :
@Prop()
|
import { Prop, raw, Schema, SchemaFactory } from "@nestjs/mongoose";
export type MessageContentDocument = MessageContent & Document;
@Schema()
export class MessageContent {
@Prop()
body: string;
@Prop(
raw({
thumbnail_url: { type: String },
}),
)
info?: Record<string, string>;
@Prop()
msgtype: string;
@Prop()
url?: string;
}
export const MessageContentSchema =
SchemaFactory.createForClass(MessageContent);