Reactive Scala Driver for MongoDB
Asynchronous & Non-Blocking
For the impatient, bellow is a complete example.
First the ReactiveMongo dependencies must be configured. Using SBT, you just have to edit
build.sbt and add the driver dependency:
Then the following code, from connection to operations on a collection, can be used in your project.
We assume that you got a running MongoDB instance. If not, get the latest MongoDB binaries and unzip the archive. Then you can launch the database:
This will start a standalone MongoDB instance that stores its data in the
data directory and listens on the TCP port 27017.
More: Setup your project
- Connect to the database
- Open database and collections
- Write documents (
- Find documents
Next: Connect to the database