File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
driver-async/src/main/com/mongodb/async/client Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 3535 * @since 3.0
3636 */
3737public final class MongoClients {
38+
39+ /**
40+ * Creates a new client with the default connection string "mongodb://localhost".
41+ *
42+ * @return the client
43+ */
44+ public static MongoClient create () {
45+ return create (new ConnectionString ("mongodb://localhost" ));
46+ }
47+
3848 /**
3949 * Create a new client with the given client settings.
4050 *
@@ -45,6 +55,16 @@ public static MongoClient create(final MongoClientSettings settings) {
4555 return new MongoClientImpl (settings , createCluster (settings , getStreamFactory (settings )));
4656 }
4757
58+ /**
59+ * Create a new client with the given connection string.
60+ *
61+ * @param connectionString the connection
62+ * @return the client
63+ */
64+ public static MongoClient create (final String connectionString ) {
65+ return create (new ConnectionString (connectionString ));
66+ }
67+
4868 /**
4969 * Create a new client with the given connection string.
5070 *
You can’t perform that action at this time.
0 commit comments