O'Reilly logo

Mastering Spring Application Development by Anjana Mankale

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required