0

I am running a Spring Boot app that has MongoDB embedded in it. When I start the app, MongoDB starts and a DB called 'testdb' is created. If I launch a mongo shell and do 'show dbs', 'testdb' is not listed. If I use Postman to POST data to MongoDB I can get it back with the GET, so I know MondoDB is working in the app.

How, if possible, can I connect to this embedded instance of MongoDB so I can test it with the shell?

gohmer
  • 55
  • 1
  • 13
  • How have you configured and launched embedded Mongo? – Andy Wilkinson Sep 02 '15 at 06:11
  • I believe the Spring Boot app when started either from the packaged jar or from within Eclipse, mongodb is started as an embedded instance; however, what I don't understand is that I have to start mongod from a Terminal command in order for either the jar instance or eclipse instance of the app to use mongodb. That is why I assumed I should be able to connect to the dbs that the app was using. – gohmer Sep 02 '15 at 16:33
  • Spring Boot will only automatically start an embedded Mongo instance if you're using 1.3.0 and you've got `de.flapdoodle.embed:de.flapdoodle.embed.mongo` on the classpath. It's impossible to tell whether that's the case from the information you've provided. Perhaps you could read http://stackoverflow.com/help/mcve and update your question accordingly? – Andy Wilkinson Sep 02 '15 at 19:44
  • I do not have `de.flapdoodle.embed:de.flapdoodle.embed.mongo`, I have `spring-boot-starter=data=mongodb-1.2.5.RELEASE`. Which I am assuming is in fact, as you say, starting an embedded instance. That was what my original question was. How to connect to an embedded instance with the mongodb shell. – gohmer Sep 03 '15 at 03:02

0 Answers0