✓ Kizspy.me
MongoDB connection string, port value, and JWT secret key in the .env file.
Implement a part of Device Management System. The situation is described as follow: a model that
has many devices involved, and a device belongs to one model.
Your database contains 3 collections, with the schema as follows:
model ({
modelName: {String, required: true, unique: true},
modelDescription: {String, required: false},
},{timestamps: true, });
device ({
user ({
deviceName: {type: String, required: true, unique: true},
deviceDescription: { type: String, required: true},
cost: {type: number, required: true, min: 0, max: 999999},
saleOff: {type: number, required: true, max: 1},
isFamous: {type: Boolean, default: false},
model: {type: mongoose.Schema. Types.ObjectId, ref: "Model", required: true},
},{timestamps: true, });
us {type: String, required: true},
pa{ type: String, required: true},
},{ timestamps: true, });
Zoom
+ 100%
Close