Answers for "role schema collection in mongoose"

0

role schema collection in mongoose

var permissions_schema = new mongoose.Schema({
    name : String,
    title : String
}); // this are mostly static data

var roles_schema = new mongoose.Schema({
    name : String,
    title : String,
    _permissions : Array
});// _permissions is an array that contain permissions _id

var contacts_schema = new mongoose.Schema({
    mobile : String,
    password : String,
    first_name : String,
    last_name : String,
    _role : Number,
    _enabled : Boolean,
    _deleted : Boolean,
    _verify_code : Number,
    _groups_id : Array,
    _service_id : String
}); // and at last _role is _id of the role which this user owns.
Posted by: Guest on September-20-2021

Browse Popular Code Answers by Language