Setting up a batch file for MongoDB

It's always easy to create a batch file to start MongoDB, and it's best to create a script file to start Mongo. This way, we won't have an error with the configuration. This would also save us a lot of time.

  1. Create a mongodbstart.bat file.
  2. Edit the file and type in the following command and save it:
    cd E:\MONGODB\mongo\bin
    mongod -dbpath e:\mongodata\db 
    

The next time you want to start MongoDB, just click on the batch file.

Order use case with Spring and MongoDB

Let us look at the Order use case to implement a simple CRUD operation using Spring and MongoDB. We are performing CRUD operations on Product, Customer, and Order documents. The scenario is this: a customer selects a product and places an order.

Following ...

Get Mastering Spring Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.