I need insert in a subdocument another subdocument I have seen some examples, but they only have a reach to the first level of subdocument
this is my model
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
var Infonodo = require('./infonodo.model');
var personSchema = new Schema({
rfc: {type:String,required:true,unique:true},
name: {type:String,required:true},
jobs:[
{
name: {type:String,required:true},
city: {type:String},
location: {type:String},
skills: [
{
name: {type:String,required:true},
time: {type:String,required:true},
where: {type:Number,required:true},
percentage: {type:String},
_info: { type: mongoose.Schema.Types.ObjectId, ref: 'Infospecific', index: true }
}
]
}
]
});
module.exports = mongoose.model('Person', personSchema);
I dont know how update or insert into 'skills', only I know update or insert into 'jobs'.
Specifically I need to know a specific job, and in this job update or insert diferent skills.
Can someone help me??