1

我正在尝试向 mongodb 发布一些内容,我的模型文件看起来像这样,并且我已经在失眠症中输入了所有必需的字段,但由于某种原因它仍然无法正常工作。

const mongoose = require('mongoose');

const Schema = mongoose.Schema;

const contactSchema = new Schema({
  name: { type: String, required: true },
  email: { type: String, required: true },
  phoneNumber: { type: Number, required: true },
  message: { type: String, required: true },
  date: { type: Date, required: false },
}); 


const Contact = mongoose.model('Contact', contactSchema);


module.exports = Contact;
4

0 回答 0