Answers for "dynamic mongo db"

0

dynamic mongo db

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);
Posted by: Guest on October-02-2021

Browse Popular Code Answers by Language