Created
January 11, 2023 14:37
-
-
Save jhaashutosh/e94c157419f795d69b842f1dd0657a4a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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