|
| 1 | +.. include:: /includes/unicode-checkmark.rst |
| 2 | + |
| 3 | +============================= |
| 4 | +MongoDB Java Reactive Streams |
| 5 | +============================= |
| 6 | + |
| 7 | +.. default-domain:: mongodb |
| 8 | + |
| 9 | +.. contents:: On this page |
| 10 | + :local: |
| 11 | + :backlinks: none |
| 12 | + :depth: 1 |
| 13 | + :class: twocols |
| 14 | + |
| 15 | +Introduction |
| 16 | +------------ |
| 17 | + |
| 18 | +**Java Reactive Streams** is an official Java driver for MongoDB and is the |
| 19 | +recommended driver for working with reactive streams in the JVM ecosystem. |
| 20 | + |
| 21 | +- `Tutorials |
| 22 | + <http://mongodb.github.io/mongo-java-driver/4.0/driver-reactive/tutorials/>`_ |
| 23 | + |
| 24 | +- `Usage Guide |
| 25 | + <http://mongodb.github.io/mongo-java-driver/4.0/driver-reactive/>`_ |
| 26 | + |
| 27 | +- `API Reference |
| 28 | + <https://mongodb.github.io/mongo-java-driver-reactivestreams/1.13/javadoc/>`_ |
| 29 | + |
| 30 | +- `Changelog |
| 31 | + <https://mongodb.github.io/mongo-java-driver-reactivestreams/1.13/changelog/>`_ |
| 32 | + |
| 33 | +- `Source Code |
| 34 | + <https://github.com/mongodb/mongo-java-driver-reactivestreams/>`_ |
| 35 | + |
| 36 | +Installation |
| 37 | +------------ |
| 38 | + |
| 39 | +The recommended way to get started using the driver in your project is with |
| 40 | +a dependency management system. |
| 41 | +See the `Installation Guide |
| 42 | +<http://mongodb.github.io/mongo-java-driver-reactivestreams/1.13/getting-started/installation-guide/>`_ |
| 43 | +for more information. |
| 44 | + |
| 45 | +Connect to MongoDB Atlas |
| 46 | +------------------------ |
| 47 | + |
| 48 | +To connect to a :atlas:`MongoDB Atlas </>` cluster, use the :atlas:`Atlas |
| 49 | +connection string </driver-connection>` for your cluster: |
| 50 | + |
| 51 | +.. code-block:: java |
| 52 | + |
| 53 | + import com.mongodb.ConnectionString; |
| 54 | + import com.mongodb.client.MongoClients; |
| 55 | + import com.mongodb.client.MongoClient; |
| 56 | + import com.mongodb.client.MongoDatabase; |
| 57 | + import com.mongodb.MongoClientSettings; |
| 58 | + |
| 59 | + // ... |
| 60 | + ConnectionString connString = new ConnectionString( |
| 61 | + "mongodb+srv://<username>:<password>@<cluster-address>/test?w=majority" |
| 62 | + ); |
| 63 | + MongoClientSettings settings = MongoClientSettings.builder() |
| 64 | + .applyConnectionString(connString) |
| 65 | + .retryWrites(true) |
| 66 | + .build(); |
| 67 | + MongoClient mongoClient = MongoClients.create(settings); |
| 68 | + MongoDatabase database = mongoClient.getDatabase("test"); |
| 69 | + |
| 70 | +See `Connect to MongoDB |
| 71 | +<http://mongodb.github.io/mongo-java-driver/4.0/driver-reactive/tutorials/>`_ |
| 72 | +for more ways to connect. |
| 73 | + |
| 74 | +Compatibility |
| 75 | +------------- |
| 76 | + |
| 77 | +MongoDB Compatibility |
| 78 | +~~~~~~~~~~~~~~~~~~~~~ |
| 79 | + |
| 80 | +.. include:: /includes/mongodb-compatibility-table-java-rs.rst |
| 81 | + |
| 82 | +.. include:: /includes/older-server-versions-unsupported.rst |
| 83 | + |
| 84 | +Language Compatibility |
| 85 | +~~~~~~~~~~~~~~~~~~~~~~ |
| 86 | + |
| 87 | +.. include:: /includes/extracts/java-rs-driver-compatibility-matrix-language.rst |
| 88 | + |
| 89 | +.. include:: /includes/language-compatibility-table-java-rs.rst |
| 90 | + |
| 91 | +How to get help |
| 92 | +--------------- |
| 93 | + |
| 94 | +- Join our `Google Group <http://groups.google.com/group/mongodb-user>`_. |
| 95 | +- Ask on `Stack Overflow |
| 96 | + <https://stackoverflow.com/questions/tagged/mongodb%20java%20reactive>`_. |
| 97 | +- Visit our `Support Channels <http://www.mongodb.org/about/support>`_. |
| 98 | +- See :java-docs-latest:`Issues & Help <issues-help/>`. |
0 commit comments