创建要在 mongodb 中发送的数据时出现错误

问题描述

exports.createBootcamp = async (req,res,next) => {
    const bootcamp = await Bootcamp.create(req.body);

    res.status(201).json({
        success: true,data: bootcamp
    });
};

错误

Bootcamp validation Failed: location.coordinates: Path `location.coordinates` is required.,location.type: Path `location.type` is required. [nodemon] app crashed - waiting for file changes before starting...

解决方法

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

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

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