Answer the question
In order to leave comments, you need to log in
How to modify a specific object in an array?
I have databases Users, Groups.
Groups have settings, they are unique and dependent on Users. I am looking for the best way to implement this.
const Users = new Schema({
Groups: [
{
type: Schema.Types.ObjectId,
ref: 'Groups'
}
]
})
const Groups = new Schema({
settings: [
User: {
type: Schema.Types.ObjectId,
ref: 'Users'
},
...
]
})
Answer the question
In order to leave comments, you need to log in
Perhaps this will work https://docs.mongodb.com/manual/reference/operator...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question