2
I have two models
in my comic book
user js.
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var bcrypt = require('bcrypt');
// User Model
var UserSchema = new Schema({
name: {
type: String,
unique: true,
required: true
},
password: {
type: String,
required: true
}
});
UserSchema.add({
email: 'string',
about: 'string',
age: 'number',
active: 'Boolean',
phone: 'number'
});
and actions.js
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var bcrypt = require('bcrypt');
var ActionSchema = new Schema({
postPerm: 'Boolean',
sendEmailPerm: 'Boolean',
editPerm: 'Boolean'
});
How do I connect them?
In case I want it all USER have a ACTIONS related where I will control them
Link with good relationship answers: https://stackoverflow.com/questions/35245685/mongoose-one-to-many/35245953
– Alan PS