Databases · DBC-24

MongoDB Basics with PHP, Python and Node.js

MongoDB Basics with PHP, Python and Node.js is a beginner course in NoSQL databases with MongoDB, from tool setup, CRUD commands, document design and indexes to MongoDB Atlas in the cloud. It suits students, teachers and developers who have used PHP and MySQL, and you leave able to connect to MongoDB from all three languages.

Updated
From 5,850 THB / person 6,500 −10% excl. VAT 7% · group rates available
PDFDownload the course outline
  • Duration12 hours · 2 days
  • FormatOnsite / live online
  • Next roundOn request
  • CertificateIncluded

Course overview

Many modern applications need to store data whose structure changes often or is nested several levels deep, such as product data where each type has different attributes, user profiles or logs from different systems. A NoSQL database such as MongoDB stores data as JSON-like documents, so it fits naturally with developers' code, adapts easily as structures change, and runs both on your own machine and in the cloud. Designed badly, though, it leads to duplicated data and slow searches.

This course lays the foundations for beginners, whether or not they have used a database before. Learners set up their tools on Windows and macOS with Docker, mongosh and MongoDB Compass, learn NoSQL concepts, create databases and collections, use CRUD commands, design document structures and use the aggregation pipeline. The course continues with indexes, access control and MongoDB Atlas in the cloud, then writes code that connects to MongoDB from PHP, Python and Node.js, ending with a working REST API, so learners see the whole picture and can build on it straight away. (2 days, 6 hours per day, 12 hours in total, Beginner level.)

What you’ll gain

  • Understand database concepts and how SQL and NoSQL differ
  • Install and use MongoDB with Docker, mongosh and MongoDB Compass
  • Manage databases, collections and documents with CRUD commands
  • Design document structures with embedding and references to suit the task
  • Use the aggregation pipeline and indexes to summarise and find data faster
  • Set up users and privileges, and work with MongoDB Atlas in the cloud
  • Write PHP, Python and Node.js code that connects to and manages MongoDB

Who this course is for

  • School and university students, and beginners who want to get to know NoSQL databases
  • Teachers, lecturers and trainers who want to use MongoDB in teaching or projects
  • Web developers who use PHP with MySQL and want to add MongoDB to their work
  • Academics, IT professionals and system administrators who look after systems that use MongoDB

Prerequisites

  • Programming experience in at least one language, such as PHP, Python or JavaScript
  • Some experience with PHP and MySQL or website design will help you learn faster
  • No previous MongoDB or NoSQL experience is required
  • A Windows or macOS laptop that can run Docker Desktop and VS Code, with permission to install software

Curriculum

Course Details

This course is the 2026 edition of Basic MongoDB with PHP Python and NodeJS, updated for MongoDB 9.0 and the current drivers for all three languages. It runs for 2 days, 6 hours per day (12 hours in total, 09:00-16:00), as lectures with labs. Beginner level. Day one lays the MongoDB foundations, from installing with Docker to CRUD commands, document design and aggregation.

Day two covers indexes, user privileges and MongoDB Atlas, then writes code that connects from PHP, Python and Node.js, ending with a working REST API. The course focuses on getting started and connecting from several languages; learners who want to go deeper into MongoDB can continue with the institute's MongoDB course. Learners take home a docker-compose file, a sample dataset and the code for every lab.

Day 1 MongoDB Basics and Managing Data

Section 1: Lab: Setting Up Tools on Windows and macOS

  • Install VS Code, Git and Docker Desktop on Windows and macOS
  • Run MongoDB 9.0 with Docker Compose and a volume for the data
  • Install mongosh, MongoDB Compass and the MongoDB for VS Code extension
  • Lab: install PHP with Composer, Python and Node.js LTS, then test the connection

Section 2: Introducing MongoDB and NoSQL Databases

  • SQL and NoSQL databases: concepts and differences in use
  • Documents, BSON and collections: how MongoDB stores data
  • Strengths, weaknesses, and the work MongoDB does and does not suit
  • MongoDB Community Server compared with MongoDB Atlas

Section 3: Lab: Creating and Managing Databases and Collections

  • Comparing RDBMS and MongoDB structures: tables, rows and columns
  • Create, list and drop databases and collections
  • Key data types such as ObjectId, Date, Decimal128 and arrays
  • Lab: set data rules with $jsonSchema schema validation

Section 4: Lab: Basic Data Commands (CRUD)

  • Create documents with insertOne and insertMany
  • Read data with find, filters, projection, sort and limit
  • Update with updateOne and updateMany using $set, $inc and $push
  • Delete documents, and upserts when no matching data exists

Section 5: Designing Document Structures

  • Embedded data models compared with referenced or normalised models
  • One-to-one, one-to-many and many-to-many relationships
  • Tree structures and the maximum document size
  • Lab: design the data for an online shop's products, customers and orders

Section 6: Lab: The Aggregation Pipeline

  • The pipeline idea and combining data step by step
  • $match, $project, $group, $sort and $limit
  • $lookup to join data across collections, and $unwind
  • Lab: summarise monthly sales with the aggregation builder in Compass
Day 2 Indexes, Atlas and Connecting from Code

Section 7: Lab: Creating and Working with Indexes

  • What an index is, and how to create, list and drop indexes in a collection
  • Index types: single field, compound, multikey, text and TTL
  • Key properties such as unique and partial indexes
  • Lab: read explain() output and compare speed before and after adding an index

Section 8: Database Access Control

  • Enable authentication, and the idea of role-based access control
  • Create user accounts, assign built-in roles and check privileges
  • Manage accounts and roles on least-privilege lines
  • Lab: keep the connection string in a .env file instead of in the code

Section 9: Lab: MongoDB Atlas in the Cloud

  • A short introduction to clusters and replica sets
  • Create a free cluster, set up a database user and the IP access list
  • Load the sample database and connect with mongosh and Compass
  • An overview of Atlas Search and Vector Search for further study

Section 10: Lab: Connecting to and Managing MongoDB with PHP

  • Install the MongoDB extension and the mongodb/mongodb library with Composer
  • Write the database connection code and handle errors
  • Work with databases, collections and documents using CRUD
  • Lab: a web page that lists and searches products from MongoDB

Section 11: Lab: Connecting to and Managing MongoDB with Python

  • Install PyMongo in a virtual environment
  • Work with databases, collections and documents through MongoClient
  • Run CRUD and aggregation from Python
  • Lab: use AsyncMongoClient for async code in place of the deprecated Motor

Section 12: Workshop: A REST API with Node.js and MongoDB

  • Create a new Node.js project and install Express and Mongoose
  • Define schemas and models with validation in Mongoose
  • Connect to MongoDB Atlas and write a REST API with full CRUD
  • Test the API with a REST client and plan the next steps

Schedule & training options

For individuals — public rounds

No public rounds are open right now. Join the waiting list and we will contact you first when the next round opens, or ask us on LINE. Or call 02-570-8449 or 088-807-9770

For organisations — in-house / private

  • Tailor the content to your team’s tools and projects
  • Your dates, at your office or live online
  • Quotation with tax ID for procurement
Corporate training quote

Instructors

Frequently asked questions

How do SQL databases differ from a NoSQL database such as MongoDB?

SQL databases store data in tables with fixed columns, link tables with foreign keys and use JOINs to query across them. MongoDB is a document-oriented NoSQL database that stores JSON-like documents (BSON) in collections. Each document can have different fields and nest related data inside it, so the structure is flexible and the system is easy to scale. MongoDB also supports multi-document transactions and schema validation rules, while SQL databases remain a strong fit for highly relational data.

When designing data in MongoDB, should you embed or use references?

Embed related data in the same document when it is always read together and its size is bounded, such as a customer's address or the items in an order, so one read returns everything. Use a reference, storing the _id of another document, when the related data is large or grows without limit, is shared by many documents or is updated separately. Remember that a single document cannot exceed 16 MB.

What is the aggregation pipeline in MongoDB used for?

The aggregation pipeline summarises and reshapes data by passing documents through a series of stages, such as $match to filter, $project to pick fields, $group to group and calculate totals or averages, $sort to order, $limit to cap the results and $lookup to pull in data from another collection. It suits reports such as total sales by product category. Put $match early so it can use an index, and use the aggregation builder in Compass to build the pipeline step by step.

Who is the MongoDB Basics with PHP, Python and Node.js course for, and what should I know beforehand?

It suits students, teachers, web developers, and IT staff or system administrators who want to start using NoSQL databases with MongoDB. You should be able to program in at least one language such as PHP, Python or JavaScript, and experience with PHP and MySQL will help. No previous MongoDB experience is needed, as the course starts from database concepts.

What will I be able to do after the MongoDB Basics with PHP, Python and Node.js course?

You will be able to explain how SQL and NoSQL differ, install MongoDB with Docker, create and manage databases and collections, write CRUD commands, design document structures, use aggregation and indexes, set user privileges, work with MongoDB Atlas in the cloud, and write PHP, Python and Node.js code that connects to MongoDB, including a REST API built with Express and Mongoose. Participants who complete the training receive a Certificate of Completion with its own number, which can be verified online.

What software does the MongoDB Basics with PHP, Python and Node.js course use?

The course uses VS Code, Git and Docker Desktop to run MongoDB locally, together with mongosh and MongoDB Compass. For connecting from code it uses the MongoDB extension and the mongodb/mongodb library via Composer for PHP, PyMongo for Python, and Express with Mongoose on a Node.js LTS release. All of these are free, and MongoDB Atlas is used on a free cluster, for which learners sign up with their own account.

Related articles

Articles are published in Thai.