📜  动态 mongo db - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:02.797000             🧑  作者: Mango

代码示例1
const mongoose = require('mongoose');

const testSchema = new mongoose.Schema({
    label: {
        required: 'please enter label',
        trim: true,
        type: String
    },
    url: {
        type: String,
        trim: true,
    },
    settings: {
      type:Schema.Types.Mixed ,
      default: {}
    } 
    }, {
        timestamps: true, strict: false
    });


module.exports = mongoose.model('test', testSchema);