我需要更新一些我正在使用 mongoose 驱动程序和 express js 的字段
架构:
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
var ProfilesSchema = new Schema({
presentRound: {
type: Number,
default: 1
},
scheduleInterviewStatus: {
type: Boolean,
default: false
},
interviewStatus: String,
ratings: [{
round: Number,
rating: Number,
feedback: String,
interviewer: String,
roundStatus: String
}]
});
Run Code Online (Sandbox Code Playgroud)
module.exports = mongoose.model('Profiles', ProfilesSchema);
所以在这些我需要通过 idpresentRound scheduleInterviewStatus interviewStatus和roundStatus(in ratings array by matching round number)
更新前:
presentRound: 1,
scheduleInterviewStatus: true,
interviewStatus: "on-hold",
ratings: [{
round: 1,
rating: 3,
feedback: …Run Code Online (Sandbox Code Playgroud)