相关疑难解决方法(0)

无法更新mongodb中的数据

我需要更新一些我正在使用 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 interviewStatusroundStatus(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)

mongoose mongodb node.js express mongodb-query

3
推荐指数
1
解决办法
5162
查看次数

标签 统计

express ×1

mongodb ×1

mongodb-query ×1

mongoose ×1

node.js ×1