为什么我不能填充厨师的文件?

问题描述

我有 3 个集合:食谱、厨师和食物类别。 我试图填充厨师收藏,但我不能;有什么问题?

const recipeSchema = new mongoose.Schema({
    chef: {
        type: mongoose.Schema.Types.ObjectId,ref: 'Chef',required: true
    },foodCategory: {
        type: mongoose.Schema.Types.ObjectId,ref: 'FoodCategory',})

const recipes = await Recipe.find({ chef: '608ed57e58e54d4b9486dae4' })
            .select("-__v")
            .sort({ name: 1 })
            .populate("Chef",'name status filePath');

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)