I found a solution to the matching problem, which is very intuitive:
User.find({
'interactions.interactor': mongoose.Types.ObjectId(user._id)
}, function (err, users) {
}
But in the callback function, I will update multiple matching users. How should I save it after the update? If there is no users.save() method, do I have to write loop save myself?
I found a solution to the matching problem, which is very intuitive:
But in the callback function, I will update multiple matching users. How should I save it after the update? If there is no users.save() method, do I have to write loop save myself?