Skip to content

Commit f430665

Browse files
(DOCSP-28861): Update Java driver change stream example (#2809)
* (DOCSP-28861): Update Java driver change stream example * add username and password to connection string
1 parent 18edf10 commit f430665

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/changeStreams.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ upper-right to set the language of the examples on this page.
375375

376376
.. code-block:: java
377377

378-
MongoClient mongoClient = new MongoClient( new MongoClientURI("mongodb://host1:port1,host2:port2..."));
378+
MongoClient mongoClient = MongoClients.create("mongodb://<username>:<password>@<host>:<port>");
379379

380380
// Select the MongoDB database and collection to open the change stream against
381381

0 commit comments

Comments
 (0)