// you need to require Model first
      // e.g >> const Model = require('./models/Model')
      try { 
          const doc = new Model({
           // document data as an object here
      }) 
          const result = await doc.save() 
          console.log(result) 
        } catch (error) { 
          console.log(error.message) 
        } 

      Javascript language logo
      your recipe card header background
      create new mongodb document

      MERN cookbook

      Shortcut: app.doc

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.