
Explore MongoDB, an open source, free, cross-platform document-oriented NoSQL database that uses BSON/JSON-like documents with dynamic schemas, supporting indexing, ad hoc queries, and sharding for scalable apps.
Compare sql and nosql databases by data models, schema flexibility, acid properties, and query languages, and explore their use cases in transactional systems and real time analytics.
Learn how to choose between SQL and NoSQL databases by evaluating data models, schemas, performance, and query languages to match your application's needs.
Learn to work with MongoDB by using UI tools such as MongoDB Compass, Studio 3D for MongoDB, and Mongo Express, run via Docker on your local machine.
Set up the development environment with docker containers, configuring a docker compose to run mongodb and mongo express for the user interface across any host.
Write a docker compose file using a text editor and save it as docker-compose.yaml. This lesson shows how to quickly get things running with no special tools required.
Learn to configure a MongoDB service in a docker compose file by defining the service, image, container name, ports, persistent volumes, and environment variables for init root credentials.
Configure a Docker Compose Mongo Express service for MongoDB, naming the container, selecting the image, setting admin credentials, and mapping ports to test connectivity.
Run and test our docker compose setup by bringing up MongoDB and Mongo Express with docker compose up. Access the Mongo Express UI at localhost:8081 to verify databases and collections.
Explore how MongoDB collections serve as document containers analogous to SQL tables, and how documents with dynamic schemas differ from fixed-schema rows, plus querying with MongoDB versus SQL.
Create a new Spring Boot 3.0 project via start.spring.io using a Maven setup, Java 17, and the 301 release, with Spring Web, Spring Data MongoDB, and Lombok.
Explore the project structure in IntelliJ, reviewing pom.xml, src, and resources for a Spring Boot with MongoDB demo, and transform application.properties to YAML via refactor using the Shift+F6 shortcut.
Include the docker compose file in the project root, run it via terminal or IntelliJ, and troubleshoot container conflicts by stopping and reinitializing MongoDB and Mongo Express.
Illustrate the architecture: clients send HTTP requests to a Spring Boot container, where controllers route to service logic, persist data with Spring Data to MongoDB via Docker and Mongo Express.
Connects a Spring Boot app to MongoDB by configuring spring.data.mongodb properties in application.yml, including username, password, host, port, database, and authentication database.
Learn how to create a new database using the Mongo Express UI, name it to avoid typos, view and manage collections, and export or import data.
Understand the admin database as MongoDB's special store for system users and versions, used for administrative tasks like user management and authenticating access, alongside local and config databases.
Create a product.java class as a document in a collection, defining id, name, and description, and apply Lombok data, all-args constructor, and a builder in a Spring Boot app.
Transform a product Java class into a MongoDB document by using the document annotation, define a string ID with the ID annotation, and persist the object to MongoDB.
Create a mongo repository by defining a repository interface that extends mongo repository for the product document with string id, enabling built-in methods like inserting, saving, and find all.
Launch a Spring Boot 3.0 app, use a CommandLineRunner to insert a product via the repository, observe lazy collection creation in MongoDB, and verify data in Mongo Express.
Implement a product service using Spring Data to perform CRUD operations on MongoDB, including save, find by id, find all, and delete, as a Spring bean with Lombok required-args constructor.
Learn to implement the save method with a repository to persist documents, using insert for new items and update for existing ones, with DTO validation and auto-generated IDs returned.
Implement the find by ID method using the repository, returning an optional product and handling or else strategies such as null, empty, or exceptions.
Implement the repository's findAll method to return a list of products, then proceed to implement the delete operation.
Delete a document using the repository by calling delete by id with the id parameter. The method deletes the document if it exists; otherwise it does nothing.
Create a product controller in a Spring Boot app to expose endpoints for save, find by id, find all, and delete, wired to the product service via a rest controller.
Learn to implement a post mapping that accepts a product via request body, calls the service's save method, and returns a response entity at /api/v1/products.
Implement a new get mapping in Spring Boot 3.0 to fetch all products from the database, returning a response entity containing a list of product objects.
Create a get mapping using a path variable for the product id, call the find by id method, and return a response entity.
Implement a delete mapping that deletes a product by its id via a path variable, invokes the service.delete method, and returns an accepted 202 response.
Extend the product model by adding a tags field as a list of strings and persist the new product in MongoDB, paving the way for a more complex, class-based object.
Extend the product document with a new category field by creating a simple category class containing name and description, annotated with Lombok, then restart the application to see the representation.
The lecture demonstrates posting a category field via Postman, observing the created document in MongoDB, and shows how non structured data allows optional fields like description.
Learn how to automatically enforce category existence when adding a product by linking the product collection to the category collection, and handle errors for unknown category ids.
Convert the category Java class into a MongoDB document by adding an id and the document annotation, turning it into a collection and persisting data after restart.
Create a category repository by extending MongoRepository with category and string id, enabling interaction with the category collection and persisting initial data at app startup.
Seed two categories at startup using a command line runner and category repository in a MongoDB demo within a Spring Boot 3.0 app, creating category one and category two.
Learn how to link two documents in Spring Boot 3.0 with MongoDB, validate category id references via Postman, and handle missing ids during app startup.
Link a product to a category with the DBRef annotation in MongoDB, ensuring a non-null ID and testing with Postman.
Integrate open API (swagger UI) into a Spring Boot app using MongoDB by adding springdoc openapi webmvc ui dependency in pom.xml, version 2.0.2; reload maven and restart to test.
Test and explore swagger ui to view api definitions, execute endpoints, and manage products, understanding how the save method creates or updates items in spring three.
Extend the product model by adding price as big decimal, quantity, and a rating field to enable currency calculations and rating-based queries with mongo template.
Create a product search service using spring data's query and criteria classes that mirror native operators, annotated as a service with required args, and inject a mongo template.
Discover how the MongoTemplate provides high-level, json-based object mapping, fluent queries, bulk operations, and transactions in Spring Boot apps built on MongoDB.
Learn how to write a MongoDB query with Spring Data MongoDB template, build a query using where and is to search by product name and fetch matching products.
The lecture demonstrates testing the is query in a Swagger UI against API V1 product search, illustrating that exact name matches require precise casing.
Demonstrate regex queries in MongoDB to fetch products by name starting with or ending with a value, using anchors and case sensitivity notes in controller methods.
Learn to implement price-based product search in Spring Boot 3.0 with MongoDB using less than and less than or equal operators, via a get endpoint, BigDecimal pricing, and swagger test.
Explore implementing a greater-than price filter in a spring boot and MongoDB app by duplicating and renaming methods, using the gt operator, and validating results via swagger.
Sort products in ascending order by a dynamic field using mongo template and document queries, with optional pagination and a dedicated endpoint.
Learn to implement paging and sorting in spring boot 3.0 with mongodb using pageable, page request, and sort by field with direction, test endpoints with swagger.
Explore auto generated queries from method names in spring data by declaring repository methods. Create a query method service and a query method controller to separate code and improve readability.
Build and test find by name queries using Spring Data MongoDB repository, leveraging find all by name, automatic query derivation, and Swagger UI through the service layer.
Update the search method to ignore case so a lowercase query like 's' or 'samsung' returns data, then restart the app and test by executing the backend call.
Implement a repository method find by name starting with to fetch products whose names begin with a given prefix, replacing regex, and test the results in Swagger showing two printers.
Implement and test a repository method find all by name ending with, pass a name parameter, and verify ends with queries return correct results like printer hp and MacBook.
Implement and test a name containing substring search in a Spring Boot and MongoDB app, using repository methods like find all by name containing ignore case to filter products.
Learn how to implement a price less than query with a repository method, passing a big decimal price, and view results in swagger ui.
Demonstrates filtering products by price using a repository method greater than, with big decimal fields, tested in swagger, and introduces filtering between two values in Spring Boot 3.0 and MongoDB.
Implement a find by price between value range in a Spring Boot MongoDB app, wiring controller, service, and repository to filter products by price between two BigDecimal values.
Implement search by a field using ignore-case name matching and then sort the results by price. Explore default ascending order with options for descending order.
Learn how to implement paging and sorting in Spring Boot using a pageable parameter. Configure page number and size with defaults and test endpoints via try it out.
Learning Spring Boot and MongoDB can be extremely valuable for students looking to gain skills in modern web development and data storage.
Here is why you need to learn and master these two technologies
Spring Boot is a popular framework for building Java-based web applications. It makes it easy to create stand-alone, production-grade Spring-based applications that you can "just run". This means that you can quickly get up and running with a new project and start building their application without having to spend time on configuration.
MongoDB is a leading NoSQL database that is widely used in modern web applications. It is a flexible, scalable, and high-performance database that can handle large amounts of data. By learning MongoDB, you will be able to build applications that can store and manage large amounts of data efficiently.
Together, Spring Boot and MongoDB form a powerful stack for building modern web applications. By learning both technologies, students will be able to build full-stack applications that can handle both the front-end and back-end aspects of web development.
There is high demand for developers with skills in Spring Boot and MongoDB. Companies of all sizes are looking for developers who can build modern web applications using these technologies, so learning them can open up new career opportunities for students.
Overall, learning Spring Boot and MongoDB can be a great investment for students looking to gain valuable skills in modern web development and data storage.
By purchasing a course on these technologies, you can learn from experienced instructor and get the support and guidance you need to succeed.