0
How to use mongoDB with spring boot?
2 Answers
+ 2
You can use this pre-initialized project and click Generate to download a ZIP file. This project is configured to fit the examples in this tutorial.
To manually initialize the project:
Navigate to https://start.spring.io. This service pulls in all the dependencies you need for an application and does most of the setup for you.
Choose either Gradle or Maven and the language you want to use. This guide assumes that you chose Java.
Click Dependencies and select Spring Data MongoDB.
Click Generate.
Download the resulting ZIP file, which is an archive of a web application that is configured with your choices.
Greetings,
J Wick
+ 1
You need to include a mongo dependency in your pom.xml file.
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-mongodb</artifactId> </dependency>
Credits:- https://www.mongodb.com/compatibility/spring-boot