Snai3i-LandingPage-FormBuilder / backend / src / models / stormModel.ts
stormModel.ts
Raw
import { Schema, model, Model } from "mongoose";

export interface StormI extends Document {
  email: string;
  code: string;
}

interface StormModelI extends Model<StormI> {}

const StormSchema = new Schema<StormI>(
  {
    email: {
      type: String,
      required: true,
    },
    code: {
      type: String,
      required: true,
    },
  },
  {
    timestamps: true,
  }
);

const StormModel = model<StormI, StormModelI>("Storm", StormSchema);
export default StormModel;