PageSourceSearch

https://codexam.vercel.app/_next/static/chunks/pages/docs/project/gg/gg17-f22cceaad774deb2.js

js codexam.vercel.app collected 2026-10-03 05:19:54 UTC 44,199 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[891],{17789:function(e,o,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/docs/project/gg/gg17",function(){return n(74706)}])},74706:function(e,o,n){"use strict";n.r(o);var t=n(11527),s=n(83850),a=n(51024),r=n(14291);n(38706),n(53127);var d=n(26736);n(42737),n(44637),n(36887),n(96052),n(35334),n(41093),n(44970),n(78605),n(40227),n(96446),n(53157),n(59010);let i={MDXContent:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{wrapper:o}=Object.assign({},(0,d.ah)(),e.components);return o?(0,t.jsx)(o,{...e,children:(0,t.jsx)(c,{...e})}):c(e)},pageOpts:{filePath:"pages/docs/project/gg/gg17.mdx",route:"/docs/project/gg/gg17",headings:[{depth:2,value:"Manual Data Inserting",id:"manual-data-inserting"},{depth:3,value:"Setting up Mongoose",id:"setting-up-mongoose"},{depth:3,value:"Adding Data to MongoDB",id:"adding-data-to-mongodb"},{depth:4,value:"Avoiding Duplicate Data",id:"avoiding-duplicate-data"},{depth:5,value:"Conclusion",id:"conclusion"},{depth:2,value:"Check Data in MongoDB",id:"check-data-in-mongodb"}],pageMap:[{kind:"Meta",data:{index:{title:"CodeXam",type:"page",display:"hidden",theme:{layout:"raw"}},playground:{title:"Playground",type:"page",theme:{toc:!1,layout:"raw",footer
1:!1}},showcase:{title:"Guide",type:"page",theme:{toc:!0}},xamdoc:{title:"Documentation",type:"page",theme:{toc:!0},items:{CXBS:{title:"CodeXam Blog Setup",href:"/xamdoc"},"Front Page":{title:"Front Page"}}},docs:{title:"Tutorial",type:"page",theme:{toc:!0}},xamdev:{title:"Writer's Space",type:"page",theme:{toc:!0}},faq:{title:"FAQ",type:"menu",items:{about:{title:"About CodeXam",href:"/docs/about"},community:{title:"Community"},soonmsz:{title:"Short Message",type:"/docs/soonmsz",display:"hidden"}}},confirm:"Confirm"}},{kind:"MdxPage",name:"confirm",route:"/confirm"},{kind:"Folder",name:"docs",route:"/docs",children:[{kind:"Folder",name:"DSA",route:"/docs/DSA",children:[{kind:"Meta",data:{erb:"Roadmap",dsr:"DataStructures Introduction",arr:"Array Data Structure",llds:"Linked List Data Structure"}},{kind:"MdxPage",name:"arr",route:"/docs/DSA/arr"},{kind:"MdxPage",name:"dsr",route:"/docs/DSA/dsr"},{kind:"MdxPage",name:"erb",route:"/docs/DSA/erb"},{kind:"MdxPage",name:"llds",route:"/docs/DSA/llds"}]},{kind:"MdxPage",name:"DSA",route:"/docs/DSA"},{kind:"Folder",name:"Hooks",route:"/docs/Hooks",children:[{kind:"Folder",name:"React",route:"/docs/Hooks/React",children:[{kind:"Meta",data:{useState:"useState",useEffect:"Useeffect"}},{kind:"MdxPage",name:"useEffect",route:"/docs/Hooks/React/useEffect"},{kind:"MdxPage",name:"useState",route:"/docs/Hooks/React/useState"}]},{kind:"MdxPage",name:"React",route:"/docs/Hooks/React"},{kind:"Meta",data:{React:"React"}}]},{kind:"MdxPage",name:"Hooks",route:"/docs/Hooks"},{kind:"Folder",name:"OopsJava",route:"/docs/OopsJava",children:[{kind:"Meta",data:{java0:"Hand Written Small Notes",java1:"Introduction Of OOPs",java2:"Basic Terminology"}},{kind:"MdxPage",name:"java0",route:"/docs/OopsJava/java0"},{kind:"MdxPage",name:"java1",route:"/docs/OopsJava/java1"},{kind:"MdxPage",name:"java2",route:"/docs/OopsJava/java2"}]},{kind:"MdxPage",name:"OopsJava",route:"/docs/OopsJava"},{kind:"Meta",data:{index:{title:"Video Tutorial",type:"page",theme:{typesetting:"article",layout:"full"}},"-- DSA --":{type:"separator",title:"Data Structures and Algorithms"},DSA:"Java,C++,Python & C","-- OOPs --":{type:"separator",title:"Object Oriented Programming"},OopsJava:"Java","-- Coding Practice --":{type:"separator",title:"Coding Practice"},leetcode:"Leetcode","-- DBMS --":{type:"separator",title:"Database Management System"},dbms:"DBMS","-- Machine Learning --":{type:"separator",title:"Machine Learning"},machinelearning:"Machine Learning Theory","-- Cyber Security --":{type:"separator",title:"Cyber Security"},cybersecurity:"Cyber Security","-- WebDev & AppDev --":{type:"separator",title:"Web & App Development"},html:"HTML Tutorial",tailwindcss:"Tailwind CSS Tutorial",js:"JavaScript Tutorial",react:"React Tutorial",reactnative:"React NativeTutorial",next:"Next.js Tutorial",Hooks:"React/Next Hooks",node:"Node.js Tutorial",docker:"Docker Tutorial","-- Projects --":{type:"separator",title:"Project Based Coaching"},project:"Project Tutorial","-- About --":{type:"separator",title:"Advance"},about:"CodeXam Website Project",soonmsz:"Message",exp:"Experiment"}},{kind:"MdxPage",name:"about",route:"/docs/about"},{kind:"Folder",name:"cybersecurity",route:"/docs/cybersecurity",children:[{kind:"Meta",data:{mod1:"Introduction To CyberSecurity"}},{kind:"MdxPage",name:"mod1",route:"/docs/cybersecurity/mod1"}]},{kind:"MdxPage",name:"cybersecurity",route:"/docs/cybersecurity"},{kind:"Folder",name:"dbms",route:"/docs/dbms",children:[{kind:"Meta",data:{dbms1:"Introduction",dbms2:"DBMS Architecture",dbms3:"ER Model",dbms4:"Extended ER Features",dbms5:"Banking System ER"}},{kind:"MdxPage",name:"dbms1",route:"/docs/dbms/dbms1"},{kind:"MdxPage",name:"dbms2",route:"/docs/dbms/dbms2"},{kind:"MdxPage",name:"dbms3",route:"/docs/dbms/dbms3"},{kind:"MdxPage",name:"dbms4",route:"/docs/dbms/dbms4"},{kind:"MdxPage",name:"dbms5",route:"/docs/dbms/dbms5"}]},{kind:"MdxPage",name:"dbms",route:"/docs/dbms"},{kind:"MdxPage",name:"docker",route:"/docs/docker"},{kind:"MdxPage",name:"exp",route:"/docs/exp"},{kind:"Folder",name:"html",route:"/docs/html",children:[{kind:"Meta",data:{cheatsheet:"HTML Cheatsheet",chapter1:"Html Basics"}},{kind:"MdxPage",name:"chapter1",route:"/docs/html/chapter1"},{kind:"MdxPage",name:"cheatsheet",route:"/docs/html/cheatsheet"}]},{kind:"MdxPage",name:"html",route:"/docs/html"},{kind:"MdxPage",name:"index",route:"/docs"},{kind:"Folder",name:"js",route:"/docs/js",children:[{kind:"Meta",data:{js1:"Unknown Facts",js2:"Setup Guide",js3:"Our IDE Use Guide",js4:"Variables And DataTypes",js5:"Primitives and Objects",js6:"Revision 1 ",js7:"Operators & Expressions",js8:"Comments Out",js9:"Prompt & Alert",js10:"Conditional Statements",js11:"Switch Statement",js12:"Ternary Operator",js13:"Revision 2",js14:"Loops in JavaScript",js15:"For Loop",js16:"While Loop",js17:"Do While Loop",js18:"Functions",js19:"Revision 3",js20:"Strings",js21:"String Methods",js22:"Escape Characters",js23:"Revision 4",js24:"Arrays",js25:"Array Methods",js26:"Revision 5"}},{kind:"MdxPage",name:"js1",route:"/docs/js/js1"},{kind:"MdxPage",name:"js10",route:"/docs/js/js10"},{kind:"MdxPage",name:"js11",route:"/docs/js/js11"},{kind:"MdxPage",name:"js12",route:"/docs/js/js12"},{kind:"MdxPage",name:"js13",route:"/docs/js/js13"},{kind:"MdxPage",name:"js14",route:"/docs/js/js14"},{kind:"MdxPage",name:"js15",route:"/docs/js/js15"},{kind:"MdxPage",name:"js16",route:"/docs/js/js16"},{kind:"MdxPage",name:"js17",route:"/docs/js/js17"},{kind:"MdxPage",name:"js18",route:"/docs/js/js18"},{kind:"MdxPage",name:"js19",route:"/docs/js/js19"},{kind:"MdxPage",name:"js2",route:"/docs/js/js2"},{kind:"MdxPage",name:"js20",route:"/docs/js/js20"},{kind:"MdxPage",name:"js21",route:"/docs/js/js21"},{kind:"MdxPage",name:"js22",route:"/docs/js/js22"},{kind:"MdxPage",name:"js23",route:"/docs/js/js23"},{kind:"MdxPage",name:"js24",route:"/docs/js/js24"},{kind:"MdxPage",name:"js25",route:"/docs/js/js25"},{kind:"MdxPage",name:"js26",route:"/docs/js/js26"},{kind:"MdxPage",name:"js3",route:"/docs/js/js3"},{kind:"MdxPage",name:"js4",route:"/docs/js/js4"},{kind:"MdxPage",name:"js5",route:"/docs/js/js5"},{kind:"MdxPage",name:"js6",route:"/docs/js/js6"},{kind:"MdxPage",name:"js7",route:"/docs/js/js7"},{kind:"MdxPage",name:"js8",route:"/docs/js/js8"},{kind:"MdxPage",name:"js9",route:"/docs/js/js9"}]},{kind:"MdxPage",name:"js",route:"/docs/js"},{kind:"Folder",name:"leetcode",route:"/docs/leetcode",children:[{kind:"Meta",data:{lc1:"Two Sum"}},{kind:"MdxPage",name:"lc1",route:"/docs/leetcode/lc1"}]},{kind:"MdxPage",name:"leetcode",route:"/docs/leetcode"},{kind:"Folder",name:"machinelearning",route:"/docs/machinelearning",children:[{kind:"Meta",data:{chapter1:"Introduction Of ML",chapter2:"Features And Labels",chapter3:"Data Collection process",chapter4:"Supervised And Unsupervised Learning",sl:"Supervised Details",usl:"Unsupervised Details",chapter5:"Scikit Learn",chapter6:"Training And Test Data",sml:"Scalable Machine Learning"}},{kind:"MdxPage",name:"chapter1",route:"/docs/machinelearning/chapter1"},{kind:"MdxPage",name:"chapter2",route:"/docs/machinelearning/chapter2"},{kind:"MdxPage",name:"chapter3",route:"/docs/machinelearning/chapter3"},{kind:"MdxPage",name:"chapter4",route:"/docs/machinelearning/chapter4"},{kind:"MdxPage",name:"chapter5",route:"/docs/machinelearning/chapter5"},{kind:"MdxPage",name:"chapter6",route:"/docs/machinelearning/chapter6"},{kind:"MdxPage",name:"sl",route:"/docs/machinelearning/sl"},{kind:"MdxPage",name:"sml",route:"/docs/machinelearning/sml"},{kind:"MdxPage",name:"usl",route:"/docs/machinelearning/usl"}]},{kind:"MdxPage",name:"machinelearning",route:"/docs/machinelearning"},{kind:"Folder",name:"next",route:"/docs/next",children:[{kind:"Meta",data:{next1:"Introduction"}},{kind:"MdxPage",name:"next1",route:"/docs/next/next1"}]},{kind:"MdxPage",name:"next",route:"/docs/next"},{kind:"Folder",name:"node",route:"/docs/node",children:[{kind:"Meta",data:{node1:"Introduction to Node js",node2:"Basic Concepts",node3:"Install and Set Up",node4:"First Node js Script",node5:"Fundamentals and Features",node6:"Core Modules",node7:"Create Server",node8:"package.json file",node9:"Challenge",node10:"Nodemon package",node11:"Create a Basic API",node12:"Taking CmdLine Input ",node13:"Display file list",node14:"CRUD Operations",node15:"Asynchronous",node16:"Handle Asynchronous Data",node17:"Node js Works: Event Loop",node18:" Express js Framework",node19:"Routing with Express.js",node20:"Rendering HTML Pages",node21:"Make Html Pages",node22:"Remove extension from URL"}},{kind:"MdxPage",name:"node1",route:"/docs/node/node1"},{kind:"MdxPage",name:"node10",route:"/docs/node/node10"},{kind:"MdxPage",name:"node11",route:"/docs/node/node11"},{kind:"MdxPage",name:"node12",route:"/docs/node/node12"},{kind:"MdxPage",name:"node13",route:"/docs/node/node13"},{kind:"MdxPage",name:"node14",route:"/docs/node/node14"},{kind:"MdxPage",name:"node15",route:"/docs/node/node15"},{kind:"MdxPage",name:"node16",route:"/docs/node/node16"},{kind:"MdxPage",name:"node17",route:"/docs/node/node17"},{kind:"MdxPage",name:"node18",route:"/docs/node/node18"},{kind:"MdxPage",name:"node19",route:"/docs/node/node19"},{kind:"MdxPage",name:"node2",route:"/docs/node/node2"},{kind:"MdxPage",name:"node20",route:"/docs/node/node20"},{kind:"MdxPage",name:"node21",route:"/docs/node/node21"},{kind:"MdxPage",name:"node22",route:"/docs/node/node22"},{kind:"MdxPage",name:"node3",route:"/docs/node/node3"},{kind:"MdxPage",name:"node4",route:"/docs/node/node4"},{kind:"MdxPage",name:"node5",route:"/docs/node/node5"},{kind:"MdxPage",name:"node6",route:"/docs/node/node6"},{kind:"MdxPage",name:"node7",route:"/docs/node/node7"},{kind:"MdxPage",name:"node8",route:"/docs/node/node8"},{kind:"MdxPage",name:"node9",route:"/docs/node/node9"}]},{kind:"MdxPage",name:"node",route:"/docs/node"},{kind:"Folder",name:"project",route:"/docs/project",children:[{kind:"Folder",name:"CrowdDeFiX",route:"/docs/project/CrowdDeFiX",children:[{kind:"Meta",data:{cdfx1:"Installation",cdfx2:"Smart Contract",cdfx3:"Deployment",cdfx4:"Client Setup",cdfx5:"Basic Setup (main.jsx)",cdfx6:"Tailwind Setup",cdfx7:"Assets",cdfx8:"Folder Setup",cdfx9:"App.jsx",cdfx10:"Page's files configuration"}},{kind:"MdxPage",name:"cdfx1",route:"/docs/project/CrowdDeFiX/cdfx1"},{kind:"MdxPage",name:"cdfx10",route:"/docs/project/CrowdDeFiX/cdfx10"},{kind:"MdxPage",name:"cdfx2",route:"/docs/project/CrowdDeFiX/cdfx2"},{kind:"MdxPage",name:"cdfx3",route:"/docs/project/CrowdDeFiX/cdfx3"},{kind:"MdxPage",name:"cdfx4",route:"/docs/project/CrowdDeFiX/cdfx4"},{kind:"MdxPage",name:"cdfx5",route:"/docs/project/CrowdDeFiX/cdfx5"},{kind:"MdxPage",name:"cdfx6",route:"/docs/project/CrowdDeFiX/cdfx6"},{kind:"MdxPage",name:"cdfx7",route:"/docs/project/CrowdDeFiX/cdfx7"},{kind:"MdxPage",name:"cdfx8",route:"/docs/project/CrowdDeFiX/cdfx8"},{kind:"MdxPage",name:"cdfx9",route:"/docs/project/CrowdDeFiX/cdfx9"}]},{kind:"MdxPage",name:"CrowdDeFiX",route:"/docs/project/CrowdDeFiX"},{kind:"Folder",name:"DeCryptX",route:"/docs/project/DeCryptX",children:[{kind:"Meta",data:{dcx1:"Intro",dcx2:"Cranq Setup",dcx3:"Metamask"}},{kind:"MdxPage",name:"dcx1",route:"/docs/project/DeCryptX/dcx1"},{kind:"MdxPage",name:"dcx2",route:"/docs/project/DeCryptX/dcx2"},{kind:"MdxPage",name:"dcx3",route:"/docs/project/DeCryptX/dcx3"}]},{kind:"Meta",data:{xt:"xamtrack",gg:"OctoSpace",CrowdDeFiX:"CrowdDeFiX",DeCryptX:" DeCryptX",mer
1nchat:"Mernchat"}},{kind:"Folder",name:"gg",route:"/docs/project/gg",children:[{kind:"Meta",data:{"-- Backend ⩒ --":{type:"separator",title:"Backend ▽"},gg1:"Installation",gg2:"Backend & Middleware",gg3:"MongoDB Registering",gg4:"ERD Model",gg5:"Model 1 - User",gg6:"Auth Routes 1",gg7:"Auth Routes 2",gg8:"Auth Routes 3",gg9:"Auth Routes 4",gg10:"Users Routes 1",gg11:"Users Routes 2",gg12:"Users Routes 3",gg13:"Posts Routes 1",gg14:"Posts Routes 2",gg15:"Posts Routes 3",gg16:"Backend Data adding",gg17:"Data Inserting","-- Frontend ⩒ --":{type:"separator",title:"Frontend ▽"},gg18:"Frontend Setup",gg19:"Redux Setup"}},{kind:"MdxPage",name:"gg1",route:"/docs/project/gg/gg1"},{kind:"MdxPage",name:"gg10",route:"/docs/project/gg/gg10"},{kind:"MdxPage",name:"gg11",route:"/docs/project/gg/gg11"},{kind:"MdxPage",name:"gg12",route:"/docs/project/gg/gg12"},{kind:"MdxPage",name:"gg13",route:"/docs/project/gg/gg13"},{kind:"MdxPage",name:"gg14",route:"/docs/project/gg/gg14"},{kind:"MdxPage",name:"gg15",route:"/docs/project/gg/gg15"},{kind:"MdxPage",name:"gg16",route:"/docs/project/gg/gg16"},{kind:"MdxPage",name:"gg17",route:"/docs/project/gg/gg17"},{kind:"MdxPage",name:"gg18",route:"/docs/project/gg/gg18"},{kind:"MdxPage",name:"gg19",route:"/docs/project/gg/gg19"},{kind:"MdxPage",name:"gg2",route:"/docs/project/gg/gg2"},{kind:"MdxPage",name:"gg3",route:"/docs/project/gg/gg3"},{kind:"MdxPage",name:"gg4",route:"/docs/project/gg/gg4"},{kind:"MdxPage",name:"gg5",route:"/docs/project/gg/gg5"},{kind:"MdxPage",name:"gg6",route:"/docs/project/gg/gg6"},{kind:"MdxPage",name:"gg7",route:"/docs/project/gg/gg7"},{kind:"MdxPage",name:"gg8",route:"/docs/project/gg/gg8"},{kind:"MdxPage",name:"gg9",route:"/docs/project/gg/gg9"}]},{kind:"MdxPage",name:"gg",route:"/docs/project/gg"},{kind:"MdxPage",name:"mernchat",route:"/docs/project/mernchat"},{kind:"Folder",name:"xt",route:"/docs/project/xt",children:[{kind:"Meta",data:{xt1:"Introduction",xt2:"create Server with Express JS",xt3:"Routes & Controllers",xt4:"Testing Postman & Thunderbolt",xt5:"MongoDB & Mongoose",xt6:"Secure with DOTENV",xt7:"Create Schema & Model",xt8:"Stored API data",xt9:"Read Data from Database",xt10:"Filtration & Searching Functionality",xt11:"Improve Filter in API ",xt12:"Bugs Handling",xt13:"Test Data Making Script",xt14:"Regex - Advance Search ",xt15:"SORT functionality",xt16:"Return Specific Document Fields",xt17:"Pagination",xt18:"Host REST API"}},{kind:"MdxPage",name:"xt1",route:"/docs/project/xt/xt1"},{kind:"MdxPage",name:"xt10",route:"/docs/project/xt/xt10"},{kind:"MdxPage",name:"xt11",route:"/docs/project/xt/xt11"},{kind:"MdxPage",name:"xt12",route:"/docs/project/xt/xt12"},{kind:"MdxPage",name:"xt13",route:"/docs/project/xt/xt13"},{kind:"MdxPage",name:"xt14",route:"/docs/project/xt/xt14"},{kind:"MdxPage",name:"xt15",route:"/docs/project/xt/xt15"},{kind:"MdxPage",name:"xt16",route:"/docs/project/xt/xt16"},{kind:"MdxPage",name:"xt17",route:"/docs/project/xt/xt17"},{kind:"MdxPage",name:"xt18",route:"/docs/project/xt/xt18"},{kind:"MdxPage",name:"xt2",route:"/docs/project/xt/xt2"},{kind:"MdxPage",name:"xt3",route:"/docs/project/xt/xt3"},{kind:"MdxPage",name:"xt4",route:"/docs/project/xt/xt4"},{kind:"MdxPage",name:"xt5",route:"/docs/project/xt/xt5"},{kind:"MdxPage",name:"xt6",route:"/docs/project/xt/xt6"},{kind:"MdxPage",name:"xt7",route:"/docs/project/xt/xt7"},{kind:"MdxPage",name:"xt8",route:"/docs/project/xt/xt8"},{kind:"MdxPage",name:"xt9",route:"/docs/project/xt/xt9"}]},{kind:"MdxPage",name:"xt",route:"/docs/project/xt"}]},{kind:"MdxPage",name:"project",route:"/docs/project"},{kind:"Folder",name:"react",route:"/docs/react",children:[{kind:"Meta",data:{react1:"Introduction",react2:"Installation",react3:"Folder Structure",react4:"jsx",react5:"Components",react6:"Styling Components",react7:"Props & Props-Types",react8:"Create Movie Website",react9:"Tools & If-Else & ternary",reactallinone:"Interview Questions"}},{kind:"MdxPage",name:"react1",route:"/docs/react/react1"},{kind:"MdxPage",name:"react2",route:"/docs/react/react2"},{kind:"MdxPage",name:"react3",route:"/docs/react/react3"},{kind:"MdxPage",name:"react4",route:"/docs/react/react4"},{kind:"MdxPage",name:"react5",route:"/docs/react/react5"},{kind:"MdxPage",name:"react6",route:"/docs/react/react6"},{kind:"MdxPage",name:"react7",route:"/docs/react/react7"},{kind:"MdxPage",name:"react8",route:"/docs/react/react8"},{kind:"MdxPage",name:"react9",route:"/docs/react/react9"},{kind:"MdxPage",name:"reactallinone",route:"/docs/react/reactallinone"}]},{kind:"MdxPage",name:"react",route:"/docs/react"},{kind:"Folder",name:"reactnative",route:"/docs/reactnative",children:[{kind:"Meta",data:{react1:"Installation",react2:"CreateApp & Debugging",react3:"File Structure",react4:"Hello World App",react5:"Styling",react6:"Hook : Dark & light",react7:"Bug Info - version 63","-- Second App ⩒ --":{type:"separator",title:"Second App ⩒"},react8:"Multi file components"}},{kind:"MdxPage",name:"react1",route:"/docs/reactnative/react1"},{kind:"MdxPage",name:"react2",route:"/docs/reactnative/react2"},{kind:"MdxPage",name:"react3",route:"/docs/reactnative/react3"},{kind:"MdxPage",name:"react4",route:"/docs/reactnative/react4"},{kind:"MdxPage",name:"react5",route:"/docs/reactnative/react5"},{kind:"MdxPage",name:"react6",route:"/docs/reactnative/react6"},{kind:"MdxPage",name:"react7",route:"/docs/reactnative/react7"},{kind:"MdxPage",name:"react8",route:"/docs/reactnative/react8"}]},{kind:"MdxPage",name:"reactnative",route:"/docs/reactnative"}
1,{kind:"MdxPage",name:"soonmsz",route:"/docs/soonmsz",frontMatter:{headeronly:!0,searchable:!1}},{kind:"Folder",name:"tailwindcss",route:"/docs/tailwindcss",children:[{kind:"Meta",data:{chapter1:"Chapter 1",chapter2:"Chapter 2"}},{kind:"MdxPage",name:"chapter1",route:"/docs/tailwindcss/chapter1"},{kind:"MdxPage",name:"chapter2",route:"/docs/tailwindcss/chapter2"}]},{kind:"MdxPage",name:"tailwindcss",route:"/docs/tailwindcss"}]},{kind:"MdxPage",name:"index",route:"/",frontMatter:{title:"CodeXam – Best Coding Learning Platform"}},{kind:"Folder",name:"playground",route:"/playground",children:[{kind:"MdxPage",name:"js",route:"/playground/js"},{kind:"Meta",data:{js:"JS"}}]},{kind:"Folder",name:"showcase",route:"/showcase",children:[{kind:"Meta",data:{bd1:{title:"Backend Development - Guide 1",type:"page",display:"hidden",theme:{display:"hidden"}}}},{kind:"MdxPage",name:"bd1",route:"/showcase/bd1"}]},{kind:"MdxPage",name:"showcase",route:"/showcase",frontMatter:{title:"Helpful Guide for Beginners"}},{kind:"Folder",name:"xamdev",route:"/xamdev",children:[{kind:"Meta",data:{index:"Introduction","-- Question --":{type:"separator",title:"QNA Template"},question:"Question & Answer Template"}},{kind:"MdxPage",name:"index",route:"/xamdev"},{kind:"Folder",name:"question",route:"/xamdev/question",children:[{kind:"Meta",data:{longquestion:"Long Question Template",mcq:"MCQ Template"}},{kind:"MdxPage",name:"longquestion",route:"/xamdev/question/longquestion"},{kind:"MdxPage",name:"mcq",route:"/xamdev/question/mcq"}]},{kind:"MdxPage",name:"question",route:"/xamdev/question"}]},{kind:"Folder",name:"xamdoc",route:"/xamdoc",children:[{kind:"Folder",name:"CXBS",route:"/xamdoc/CXBS",children:[{kind:"Meta",data:{ra:"\uD83C\uDFDB REST Architecture",rk:"\uD83D\uDD11 REST Key",crp:"\uD83D\uDCDD Client Requirements",fr:"\uD83D\uDCDA Resource",ideig:"\uD83D\uDEE0 Installation Guide",dbst:" \uD83D\uDDC4 Database Structure",setup:"⚙️ Setup",uapi:"\uD83D\uDCE1 User API"}},{kind:"MdxPage",name:"crp",route:"/xamdoc/CXBS/crp"},{kind:"MdxPage",name:"dbst",route:"/xamdoc/CXBS/dbst"},{kind:"MdxPage",name:"fr",route:"/xamdoc/CXBS/fr"},{kind:"MdxPage",name:"ideig",route:"/xamdoc/CXBS/ideig"},{kind:"MdxPage",name:"ra",route:"/xamdoc/CXBS/ra"},{kind:"MdxPage",name:"rk",route:"/xamdoc/CXBS/rk"},{kind:"MdxPage",name:"setup",route:"/xamdoc/CXBS/setup"},{kind:"MdxPage",name:"uapi",route:"/xamdoc/CXBS/uapi"}]},{kind:"MdxPage",name:"CXBS",route:"/xamdoc/CXBS"},{kind:"Meta",data:{CXBS:"Backend"}}]},{kind:"MdxPage",name:"xamdoc",route:"/xamdoc",frontMatter:{title:"Developer Space CodeXam"}}],flexsearch:{codeblocks:!1},title:"Gg17"},pageNextRoute:"/docs/project/gg/gg17",nextraLayout:a.ZP,themeConfig:r.Z};function c(e){let o=Object.assign({h2:"h2",h3:"h3",p:"p",code:"code",blockquote:"blockquote",pre:"pre",span:"span",h4:"h4",h5:"h5",ul:"ul",li:"li",a:"a"},(0,d.ah)(),e.components);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flex nx-justify-between",children:(0,t.jsx)("h1",{children:(0,t.jsx)("span",{className:"p-0 sm:p-0 headingGradientTag font-bold text-transparent sm:text-8xl text-[50px] ",children:"Data Inserting"})})}),"\n",(0,t.jsx)("div",{className:"mt-5"}),"\n",(0,t.jsx)(o.h2,{id:"manual-data-inserting",children:"Manual Data Inserting"}),"\n",(0,t.jsx)("div",{className:"mt-3"}),"\n",(0,t.jsx)("div",{className:"cardTexture5",children:(0,t.jsxs)("h11",{className:"textStyle1",children:[(0,t.jsx)(o.h3,{id:"setting-up-mongoose",children:"Setting up Mongoose"}),(0,t.jsxs)(o.p,{children:["Before we can start inserting data into our MongoDB database, we need to set up Mongoose in our server-side code. We'll need to import the ",(0,t.jsx)(o.code,{children:"User"})," and ",(0,t.jsx)(o.code,{children:"Post"})," models and the data that we want to insert into the database."]}),(0,t.jsxs)(o.blockquote,{children:["\n",(0,t.jsx)(o.p,{children:"Now we need to import User and Post from Model(Schema) and import users and posts from dataset."}),"\n"]}),(0,t.jsx)(o.pre,{"data-language":"text","data-theme":"default",hasCopyCode:!0,children:(0,t.jsxs)(o.code,{"data-language":"text","data-theme":"default",children:[(0,t.jsx)(o.span,{className:"line",children:(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"server"})}),"\n",(0,t.jsx)(o.span,{className:"line",children:(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"├── index.js"})}),"\n",(0,t.jsx)(o.span,{className:"line",children:(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"}})})]})}),(0,t.jsx)(o.pre,{"data-language":"js","data-theme":"default",hasCopyCode:!0,children:(0,t.jsxs)(o.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" User "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"from"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"./models/User.js"'}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:";"})]}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" Post "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"from"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"./models/Post.js"'}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:";"})]}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"import"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" { users"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" posts } "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"from"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-string-expression)"},children:'"./data/index.js"'}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:";"})]})]})}),(0,t.jsx)(o.h3,{id:"adding-data-to-mongodb",children:"Adding Data to MongoDB"}),(0,t.jsxs)(o.p,{children:["Once we have our models and data imported, we can add the data to our MongoDB database using the ",(0,t.jsx)(o.code,{children:"insertMany"})," method. In the following code snippet, we're inserting the ",(0,t.jsx)(o.code,{children:"users"})," data into the ",(0,t.jsx)(o.code,{children:"User"})," collection and the ",(0,t.jsx)(o.code,{children:"posts"})," data into the ",(0,t.jsx)(o.code,{children:"Post"})," collection."]}),(0,t.jsx)(o.pre,{"data-language":"js","data-theme":"default",hasCopyCode:!0,children:(0,t.jsxs)(o.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"    "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"User"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".insertMany"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"(users);"})]}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"    "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"Post"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".insertMany"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"(posts);"})]})]})}),(0,t.jsx)(o.pre,{"data-language":"js","data-theme":"default",hasCopyCode:!0,children:(0,t.jsxs)(o.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsx)(o.span,{className:"line",children:(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-comment)"},children:"/* MONGOOSE SETUP */"})}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"const"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"PORT"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"process"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"."}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"env"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"."}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"PORT"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"||"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"6001"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:";"})]}),"\n",(0,t.jsx)(o.span,{className:"line",children:(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"mongoose"})}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"  "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".connect"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"process"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"."}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"env"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"."}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"MONGO_URL"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" {"})]}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"    useNewUrlParser"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"true"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"    useUnifiedTopology"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"true"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,t.jsx)(o.span,{className:"line",children:(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"  })"})}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"  "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".then"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"(() "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" {"})]}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"    "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"app"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".listen"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"PORT"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" () "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"console"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".log"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-string-expression)"},children:"`Server Port: "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"${"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"PORT"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"}"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-string-expression)"},children:"`"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"));"})]}),"\n",(0,t.jsx)(o.span,{className:"line",children:" "}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"    "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-comment)"},children:"/* ADD DATA ONE TIME */"})]}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"    "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"User"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".insertMany"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"(users);"})]}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"    "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"Post"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".insertMany"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"(posts);"})]}),"\n",(0,t.jsx)(o.span,{className:"line",children:(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"  })"})}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"  "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".catch"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"((error) "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"console"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".log"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-string-expression)"},children:"`"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"${"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"error"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"}"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-string-expression)"}
1,children:" did not connect`"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"));"})]})]})}),(0,t.jsx)(o.h4,{id:"avoiding-duplicate-data",children:"Avoiding Duplicate Data"}),(0,t.jsx)(o.p,{children:"It's important to be careful when adding data to your MongoDB database, especially if you're doing it manually. If you accidentally insert the same data multiple times, you could end up with duplicate information that could cause issues later on."}),(0,t.jsxs)(o.p,{children:["To avoid this problem, we can comment out the ",(0,t.jsx)(o.code,{children:"insertMany"})," calls after we've added the data once. This way, we'll only add the data to the database when we need to."]}),(0,t.jsx)(o.pre,{"data-language":"js","data-theme":"default",hasCopyCode:!0,children:(0,t.jsxs)(o.code,{"data-language":"js","data-theme":"default",children:[(0,t.jsx)(o.span,{className:"line",children:(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-comment)"},children:"/* MONGOOSE SETUP */"})}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"const"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"PORT"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"="}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"process"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"."}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"env"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"."}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"PORT"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"||"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"6001"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:";"})]}),"\n",(0,t.jsx)(o.span,{className:"line",children:(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"mongoose"})}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"  "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".connect"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"process"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"."}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"env"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"."}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"MONGO_URL"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" {"})]}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"    useNewUrlParser"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"true"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"    useUnifiedTopology"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:":"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"true"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-punctuation)"},children:","})]}),"\n",(0,t.jsx)(o.span,{className:"line",children:(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"  })"})}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"  "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".then"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"(() "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" {"})]}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"    "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"app"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".listen"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"PORT"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-punctuation)"},children:","}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" () "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"console"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".log"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-string-expression)"},children:"`Server Port: "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"${"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"PORT"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"}"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-string-expression)"},children:"`"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"));"})]}),"\n",(0,t.jsx)(o.span,{className:"line",children:" "}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"    "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-comment)"},children:"/* ADD DATA ONE TIME */"})]}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"    "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-comment)"},children:"// User.insertMany(users);"})]}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"    "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-comment)"},children:"// Post.insertMany(posts);"})]}),"\n",(0,t.jsx)(o.span,{className:"line",children:(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"  })"})}),"\n",(0,t.jsxs)(o.span,{className:"line",children:[(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"  "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".catch"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"((error) "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"=>"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:" "}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-constant)"},children:"console"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-function)"},children:".log"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"("}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-string-expression)"},children:"`"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"${"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"error"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-keyword)"},children:"}"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-token-string-expression)"}
1,children:" did not connect`"}),(0,t.jsx)(o.span,{style:{color:"var(--shiki-color-text)"},children:"));"})]})]})}),(0,t.jsx)(o.h5,{id:"conclusion",children:"Conclusion"}),(0,t.jsx)(o.p,{children:"Manually inserting data into a MongoDB database using Mongoose is a straightforward process. By following the steps outlined in this article, you can quickly and easily add data to your database, while also avoiding the pitfalls of inserting duplicate data."})]})}),"\n",(0,t.jsx)(o.h2,{id:"check-data-in-mongodb",children:"Check Data in MongoDB"}),"\n",(0,t.jsx)("div",{className:"mt-3"}),"\n",(0,t.jsx)("div",{className:"cardTexture5",children:(0,t.jsxs)("h11",{className:"textStyle1",children:[(0,t.jsx)(o.p,{children:"To check the inserted data in MongoDB when using the MongoDB Atlas cloud service, you can follow these steps:"}),(0,t.jsxs)(o.ul,{children:["\n",(0,t.jsxs)(o.li,{children:["Log in to your MongoDB Atlas account at ",(0,t.jsx)(o.a,{href:"https://cloud.mongodb.com/",children:"https://cloud.mongodb.com/"}),"."]}),"\n",(0,t.jsx)(o.li,{children:"Select the project that contains the database you want to check."}),"\n",(0,t.jsx)(o.li,{children:"In the left-hand menu, click on Databases"}),"\n",(0,t.jsx)(o.li,{children:"You can see Cluster0 in the list of databases and connect , view monitoring, browse collections, and more."}),"\n",(0,t.jsx)(o.li,{children:"Click on the browse collections button to see the collections in the database."}),"\n",(0,t.jsx)(o.li,{children:"Now click on Collection tab to see the data in the collection."}),"\n",(0,t.jsx)(o.li,{children:"In the right-hand side you can see refresh button to refresh the data in the collection."}),"\n",(0,t.jsx)(o.li,{children:"In the left-hand side now you can see the database name and two collections name users and posts."}),"\n",(0,t.jsx)(o.li,{children:"Now click on the posts collection to see the data in the collection."}),"\n"]}),(0,t.jsx)(o.p,{children:"By following these steps, you can easily check and manage the data in your MongoDB database when using the MongoDB Atlas cloud service."})]})})]})}o.default=(0,s.j)(i)}},function(e){e.O(0,[1791,3159,4291,8302,9774,2888,179],function(){return e(e.s=17789)}),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.