Skip to content

Commit 961a3dd

Browse files
authored
[mongodb] upgraded to latest driver, allow SRV style mongodb URI, fix readme example (#1360)
1 parent cf40f40 commit 961a3dd

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@ To build the full distribution, with all database bindings:
7777

7878
To build a single database binding:
7979

80-
mvn -pl mongodb-binding -am clean package
80+
mvn -pl site.ycsb:mongodb-binding -am clean package

mongodb/src/main/java/site/ycsb/db/MongoDbClient.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,11 @@ public void init() throws DBException {
194194

195195
url = OptionsSupport.updateUrl(url, props);
196196

197-
if (!url.startsWith("mongodb://")) {
197+
if (!url.startsWith("mongodb://") && !url.startsWith("mongodb+srv://")) {
198198
System.err.println("ERROR: Invalid URL: '" + url
199199
+ "'. Must be of the form "
200-
+ "'mongodb://<host1>:<port1>,<host2>:<port2>/database?options'. "
200+
+ "'mongodb://<host1>:<port1>,<host2>:<port2>/database?options' "
201+
+ "or 'mongodb+srv://<host>/database?options'. "
201202
+ "http://docs.mongodb.org/manual/reference/connection-string/");
202203
System.exit(1);
203204
}

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ LICENSE file.
138138
<kudu.version>1.6.0</kudu.version>
139139
<maprhbase.version>1.1.8-mapr-1710</maprhbase.version>
140140
<!--<mapkeeper.version>1.0</mapkeeper.version>-->
141-
<mongodb.version>3.8.0</mongodb.version>
141+
<mongodb.version>3.11.0</mongodb.version>
142142
<mongodb.async.version>2.0.1</mongodb.async.version>
143143
<openjpa.jdbc.version>2.1.1</openjpa.jdbc.version>
144144
<orientdb.version>2.2.37</orientdb.version>

0 commit comments

Comments
 (0)