You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
allowing an application to be notified when a command starts and when it either succeeds or fails.
51
51
52
-
An application registers command listeners with a `MongoClient` by configuring `MongoClientOptions` with instances of classes
52
+
An application registers command listeners with a `MongoClient` by configuring `MongoClientSettings` with instances of classes
53
53
that implement the [`CommandListener`]({{< apiref "mongodb-driver-core" "com/mongodb/event/CommandListener" >}}) interface. Consider the following, somewhat
54
54
simplistic, implementation of the `CommandListener` interface:
Copy file name to clipboardExpand all lines: docs/reference/content/driver/tutorials/authentication.md
+53-23Lines changed: 53 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,15 +31,16 @@ Legacy MongoClient API:
31
31
32
32
```java
33
33
importcom.mongodb.MongoClient;
34
-
importcom.mongodb.MongoClientURI;
34
+
importcom.mongodb.ConnectionString;
35
35
```
36
36
37
37
An authentication credential is represented as an instance of the
38
38
[`MongoCredential`]({{< apiref "mongodb-driver-core" "com/mongodb/MongoCredential.html" >}}) class. The [`MongoCredential`]({{< apiref "mongodb-driver-core" "com/mongodb/MongoCredential.html" >}}) class includes static
39
39
factory methods for each of the supported authentication mechanisms.
40
40
41
-
You can also use a [`MongoClientURI`]({{< apiref "mongodb-driver-core" "com/mongodb/MongoClientURI.html" >}}) and pass it to a
42
-
[`MongoClient()`]({{< apiref "mongodb-driver-sync" "com/mongodb/client/MongoClient.html" >}}) constructor that takes a `MongoClientURI` parameter.
41
+
You can also use a [`ConnectionString`]({{< apiref "mongodb-driver-core" "com/mongodb/ConnectionString.html" >}}) and pass it to a
42
+
[`MongoClient()`]({{< apiref "mongodb-driver-legacy" "com/mongodb/MongoClient.html" >}}) constructor that takes a `ConnectionString`
0 commit comments