I have the following model representing the existing json file.
Player = config.mongoose.model('Player', {
birthday: {type: Date, required: true}, //
nationality: {type: String, required: true}, //
id: {type: Number, required: true}, //
more: {
injured: {type: Number, required: false},
current_club: {type: Number, required: false},
}
}
);
module.exports = Player;
I want to add the amounth of goals scored to the player and save this. This has to be done underneath the current_club with required false. Also I want to update a nationality when a player decides to play for a country different from the one stored in existing json file.
What i basically want to know how to 'call' the model, walk trough it and save it.
kind regards