Skip to content

Commit f791837

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 111c1a8 commit f791837

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
@@ -373,7 +373,7 @@ upper-right to set the language of the examples on this page.
373373

374374
.. code-block:: java
375375

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

378378
// Select the MongoDB database and collection to open the change stream against
379379

0 commit comments

Comments
 (0)