Advertisement
shopnilSS

ModelSchema

Dec 5th, 2021
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const mongoose = require('mongoose');
  2. const Schema = mongoose.Schema;
  3.  
  4. const practiceSchema = new Schema ({
  5.     firstName : {
  6.         type: String,
  7.         required: true
  8.     },
  9.     lastName: {
  10.         type: String,
  11.         required: true
  12.     },
  13.     contact : [String],
  14.     gender: {
  15.         type:String,
  16.         enum: ["Male", "Female"]
  17.     }
  18. })
  19.  
  20. const createModel = mongoose.model ("Newaz", practiceSchema)
  21.  
  22. module.exports = createModel
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement