GameSession : {
_id: "e055dbe445dda0332dc7cbd4c"
amount: 500,
location: {type: mongoose.Schema.ObjectId, ref: 'Location'},
madeBy: {type: mongoose.Schema.ObjectId, ref: 'User'},
}
User: {
_id: "e055dfesd445dda0332dc7et54ge"
points: 5000
}
I get the sessions and I populate the document
let sessions = await GameSession.find({location: location._id}).populate('madeBy', '_id points').exec()
I get the data correctly. Now if I make some changes to the populated data like…
sessions.madeBy.points = 200
Is there any way to save this change?