{"repo":"svenkubiak/embedded-mongodb","free":true,"listed":false,"github":"https://github.com/svenkubiak/embedded-mongodb","clone":"git clone https://github.com/svenkubiak/embedded-mongodb.git","description":"Embedded MongoDB for unit testing purposes based on flapdoodle-oss/de.flapdoodle.embed.mongo","language":"Java","stars":16,"topics":["development","embedded","in-memory","mongodb","testing"],"license":"Apache-2.0","category":"dev-tools","readme_excerpt":"embedded-mongodb ================ A small Java wrapper around [flapdoodle-oss/de.flapdoodle.embed.mongo][1] that makes it easy to run an embedded MongoDB instance for unit tests and local development. The library downloads the matching mongod binary for your platform, starts it as a child process, and shuts it down again when you call stop() or when the JVM exits. This project is intended for testing or development only. The embedded server runs without authentication and should not be exposed to untrusted networks. Requirements ------------ Library version Java version ----------------- -------------- 7.x Java 17 8.x Java 21 9.x Java 25 Defaults -------- When created without further configuration, an instance uses: Setting Default value --------- --------------- Host localhost Port 29019 Version MongoDB 7.0 ( Version.Main.V7 0 ) IPv6 disabled The default port is deliberately not 27017 to reduce the chance of clashing with a locally installed MongoDB. Usage ----- 1. Add the dependency 2. Start and stop the server The simplest way to start an embedded MongoDB with the defaults: Or in one step: Always stop the instance when you are done, for example in an @AfterEach method in your tests: If the JVM shuts down before stop() is called, a shutdown hook registered at instance creation will attempt to stop the process automatically. Check whether the server is running before connecting: 3. Connect with the MongoDB Java driver Configuration ------------- All configuration methods ret","default_branch":null,"files":null,"tree":[],"storefront":"/r/svenkubiak","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/svenkubiak/embedded-mongodb/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}