尝试获取对象-猫鼬

时间:2020-11-07 21:42:23

标签: javascript node.js mongoose

    const scheduleMessageSchema = new Schema({
        guildId: Number,
        setting: {
        logs: Boolean,
        deleteCH: Boolean,
        updateCH: Boolean,
        voiceupdateState: Boolean,
        memberaddServer: Boolean,
      }
});

我有一个这种类型的图表。您需要获取日志对象的值。 我试图这样做-server.setting[logs]

1 个答案:

答案 0 :(得分:0)

const scheduleMessageSchema = new Schema({
        guildId: Number,
        setting: {
        logs: Boolean,
        deleteCH: Boolean,
        updateCH: Boolean,
        voiceupdateState: Boolean,
        memberaddServer: Boolean,
      }
});

要访问日志,请使用=> server.setting.logs