Monday, 22 May 2017

MongoDB what is the best way to store Basic Information in DB

I am using MongoDB as Database and Mongoose as Driver in my application. I need your guides to now what is the best way to store some of application options in DB? I will show these options in dropdown options and user can select one of them.

here is the ideas (just with 1 document and all options value in array):

var BasicInfoModel = new Schema({
    categoryCapabilities:[String],
    categoryTypes:[String],
    employeeStatus:[String],
    employeeKnowledge:[String]
}); 

another way (for each option type 1 document and all options in array):

var BasicInfoModel = new Schema({
    documentType:String,
    categoryCapabilities:[String]
});

another way (for each option 1 document):

var BasicInfoModel = new Schema({
    documentType:String,
    KeyName:String
});



via Saeid Ostad

No comments:

Post a Comment