I have schema like :
const UserSchema = new mongoose.Schema({
skills: [{
_id: false,
name: String,
level: Number,
exp: Number
}]
});
As example document is like :
{
"_id": {
"$oid": "5b0941419703f80a121c44df"
},
"skills": [
{
"name": "woodcutting",
"exp": 1110,
"level": 1
},
{
"name": "smithing",
"level": 0,
"exp": 0
},
{
"name": "reading",
"level": 0,
"exp": 0
},
{
"name": "writing",
"level": 0,
"exp": 0
}
]
}
So I just need to update exp and level of woodcutting and smithing in one query, is it possible, if possible, how? Or will I need to change all array and set(replace) with it value of skills?