easy-express-cwa
Version:
CLI tool to setup a common Express.js backend developed by codewithashim
21 lines (18 loc) • 402 B
text/typescript
import { Schema, model } from "mongoose";
import { IExample, ExampleModel } from "./example.interface";
const ExampleSchema = new Schema<IExample>(
{
title: {
type: String,
required: true,
},
description: {
type: String,
required: true,
},
},
{
timestamps: true,
}
);
export const Example = model<IExample, ExampleModel>("Example", ExampleSchema);