Skip to content

Instantly share code, notes, and snippets.

@jhaashutosh
Created January 11, 2023 14:37
Show Gist options
  • Save jhaashutosh/e94c157419f795d69b842f1dd0657a4a to your computer and use it in GitHub Desktop.
Save jhaashutosh/e94c157419f795d69b842f1dd0657a4a to your computer and use it in GitHub Desktop.
const mongoose = require("mongoose");
const unitSchema = mongoose.Schema({
code: {
type: Number,
required: true,
},
unit: {
type: String,
default: "",
},
nccHq: {
type: String,
required: true,
},
location: {
type: String,
default: "",
},
email: String,
nameOfIncharge: {
type: String,
default: "",
},
officeNumbers: [String],
mobileNumbers: [String],
institutes: [
{
code: {
type: Number,
required: true,
},
unit: {
type: String,
default: "",
},
nameOfInstitute: {
type: String,
required: true,
},
location: String,
contactName: String,
nameOfPrincipal: String,
nameOfANO: String,
mobileNumbers: [String],
officeNumbers: [String],
email: String,
},
],
});
module.exports = mongoose.model("Unit", unitSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment