1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
import { Schema } from 'mongoose'; import model from '../lib/event.model'; interface Context { message: string; } const contextSchema = new Schema({ message: String }); const CustomEventModel = model<Context>('CustomEvent', contextSchema); export default CustomEventModel;