create mongoDB model

    1

    2

    lucycodes42

    MERN cookbook

    Library: express

    Shortcut: app.model

    const mongoose = require('mongoose')    
    const Schema Name = mongoose.Schema({
        name : {
            type : String,
            default : 'default txt',
        },
    })
    module.exports =  mongoose.model( 'model name' , Schema Name)
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.