In this video, we create our Task Model and Schema using Mongoose.
We will define the shape of our task data what fields a task should have, what type they are, and how MongoDB will store them.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 WHAT YOU WILL LEARN
What is a Schema in Mongoose
What is a Model and how it is different from Schema
How to define fields with type and validation
What required and default mean in Mongoose
What timestamps option does automatically
How Task model maps to tasks collection in MongoDB
How to export the model for use in other files
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🗂️ COMPLETE SERIES PLAYLIST
/ playlistlist=plkiziyqytjbv0yxo5jvj58havquz...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📌 ALL VIDEOS IN THIS SERIES
#1 - Project Intro + Demo
#2 - Backend Setup — Express + dotenv + cors
#3 - MongoDB Connection + Mongoose
#4 - Task Model + Schema (This Video)
#5 - CRUD Controllers
#6 - Routes + Postman Testing
#7 - Frontend Setup — Vite + React + Tailwind CSS
#8 - Fetch + Display Tasks
#9 - Add + Delete Tasks
#10 - Complete Task + Full Project Review
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🛠️ TOOLS USED
Node.js — nodejs.org
VS Code — code.visualstudio.com
MongoDB Atlas — mongodb.com/atlas
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📦 PACKAGES USED IN THIS VIDEO
mongoose (already installed)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📁 FILES CREATED IN THIS VIDEO
server/
├── src/
│ ├── models/
│ │ └── task.model.js
If this helped you, please like and subscribe to jdcodebase. It really helps the channel grow.
#mern #mernstack #mongodb #mongoose #mongooseschema
#mongoosemodel #nodejs #webdevelopment #beginners #jdcodebase
#javascript #jdcodebase