const mongoose = require("mongoose");
const schema = new mongoose.Schema({
integrations: {
discord: {
guild: {
type: String,
maxlength: [20, "Guild ID cannot be longer than 20 characters"],
required: true,
},
},
},
});
module.exports = mongoose.model("Hub", schema);
字符串
这是我的 Mongoose 模式。当使用.findOne时,我如何在integrations.discord.guild中通过其guild获得Hub
1条答案
按热度按时间deyfvvtc1#
用于查询嵌套字段
字符串