/** * @author songxiwen * @date 2020/08/25 11:05 */ import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document } from 'mongoose'; import { MongoDBCollection } from '../../../constant'; @Schema({ collection: MongoDBCollection.Element }) export class Element extends Document { @Prop() name!: string; @Prop() weight!: number; @Prop() parentId?: string; } export const elementSchema = SchemaFactory.createForClass(Element);