File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ defmodule Mongo.UrlParser do
6
6
# https://docs.mongodb.com/manual/reference/connection-string/#connections-connection-options
7
7
@ mongo_options % {
8
8
# Path options
9
+ "appName" => :string ,
9
10
"username" => :string ,
10
11
"password" => :string ,
11
12
"database" => :string ,
Original file line number Diff line number Diff line change @@ -83,5 +83,18 @@ defmodule Mongo.UrlParserTest do
83
83
]
84
84
end
85
85
end
86
+
87
+ test "appName option" do
88
+ url = "mongodb://USERNAME:PASSWORD@HOST:PORT/DATABASE?ssl=true&replicaSet=globaldb&appName=APP"
89
+ assert UrlParser . parse_url ( url: url ) == [
90
+ username: "USERNAME" ,
91
+ password: "PASSWORD" ,
92
+ database: "DATABASE" ,
93
+ app_name: "APP" ,
94
+ set_name: "globaldb" ,
95
+ ssl: true ,
96
+ seeds: [ "HOST:PORT" ]
97
+ ]
98
+ end
86
99
end
87
100
end
You can’t perform that action at this time.
0 commit comments