Show Topics
Hide Topics

Spring Boot MongoDB REST Example


Configuration file


we need to model our documents. Let’s call ours ‘Student’ and give it a make, model, and description. Here is our Java class to accomplish this.

  • @Id- id provided by Mongo for a document.
  • @Documentprovides a collection name.

The MongoRepository provides basic CRUD operation methods and also an API to find all documents in the collection.



Download Example