import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; import { Document } from 'mongoose'; import {ApiProperty} from '@nestjs/swagger'; export class StoreRequest { @ApiProperty() key: string; @ApiProperty() value: any; } export class StoreResponse { @ApiProperty() key: string; @ApiProperty() value: any; @ApiProperty() _id: string; @ApiProperty() __v: number; } @Schema() export class Store extends Document { @Prop({ required: true, unique: true, type: String, }) key: string; @Prop({ required: true, type: {} }) value: any; } export const StoreSchema = SchemaFactory.createForClass(Store);