【发布时间】:2020-10-16 05:46:31
【问题描述】:
我正在尝试使用以下字段在 mongoose 中创建会议模型-
const meetingSchema = new mongoose.Schema({
meeting_id: {
type: String,
required: true
},
title: {
type: String,
required: true
},
date: {
type: String,
required: true
},
time: {
type: String,
required: true
},
organiser: {
type: String,
required: true
},
attendies: []
}, { timestamps: true} );
但是当我尝试通过邮递员创建会议时,它给了我“无法发布 /api/meeting/post”的错误。 我的参加者字段有什么问题,因为我想将其设置为字符串数组,还有比字符串更好的方法来设置日期和时间字段吗? 我是 nodejs 和 mongoose 的新手
【问题讨论】:
-
架构看起来很实用。请求的应用程序/邮递员中产生了什么错误?
-
它返回一些带有 pre 标签的 html 说不能 POST /api/meeting/post
标签: node.js mongoose mongoose-schema