【发布时间】:2020-04-24 07:43:12
【问题描述】:
我在网上搜索了 2 天,没有找到任何答案,
const mongoose = require('mongoose');
const channelsSchema = new mongoose.Schema(
{
stateName: {
type: String,
required: [true, 'A state must have a name'],
unique: true,
index:true
},
id: {
type:String
},
Name: {
type:String
},
**anyThing: [Object]
},
{ strict: false }
);
const Channels = mongoose.model('Channels', channelsSchema);
module.exports = Channels;
有没有办法**anything 接受任何东西?
注意:这不是一个大项目,我也不担心安全问题。它只在本地运行
【问题讨论】:
标签: node.js mongodb mongoose crud