Skip to content

Commit 46ff8df

Browse files
committed
Fixed #15
1 parent f90d89d commit 46ff8df

File tree

2 files changed

+33
-19
lines changed

2 files changed

+33
-19
lines changed

CHANGELOG.md

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
## v0.5.4
1+
## 0.5.5
2+
3+
* Bug Fixes
4+
* Fixed a match error when using Windows OS
5+
6+
## 0.5.4
27

38
* Enhancements
49
* The driver provides now client metadata
@@ -9,7 +14,7 @@
914
* Merged changes from https://github.com/ankhers/mongodb/pull/283
1015
* Merged changes from https://github.com/ankhers/mongodb/pull/281
1116

12-
## v0.5.3
17+
## 0.5.3
1318

1419
* Enhancements
1520
* Travis now using the right MongoDB version
@@ -18,14 +23,14 @@
1823
* Added test unit for change streams
1924
* Removed debug code from change streams
2025

21-
## v0.5.2
26+
## 0.5.2
2227

2328
* Enhancements
2429
* Added `op_msg` support ([See](https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-msg))
2530
* Fixed change streams in case of error codes: 11601, 136 and 237 from resuming
2631
* Reorganized error handling
2732

28-
## v0.5.1
33+
## 0.5.1
2934

3035
* Enhancements
3136
* Upgraded to DBConnection 2.0.6
@@ -36,7 +41,7 @@
3641
* Add support for MongoDB 3.6 collection [Change Streams](https://docs.mongodb.com/manual/changeStreams/)
3742
* Ass support for SCRAM-SHA-256 (MongoDB 4.x)
3843

39-
## v0.4.8-dev
44+
## 0.4.8-dev
4045

4146
* Enhancements
4247
* Added hostname and port to exceptions
@@ -49,20 +54,20 @@
4954
* Properly parse write concern for URL
5055
* Properly follow read preference for `secondary_preferred`
5156

52-
## v0.4.7
57+
## 0.4.7
5358

5459
* Enhancements
5560
* Added 4.0 to supported versions
5661
* Initial support for mongodb+srv URLs
5762
* Support for Decimal128
5863

59-
## v0.4.6
64+
## 0.4.6
6065

6166
* Enhancements
6267
* Added `:connect_timout_ms` to `Mongo.start_link/1`
6368
* Reorganized documentation
6469

65-
## v0.4.5 (2018-04-08)
70+
## 0.4.5 (2018-04-08)
6671

6772
* Enhancements
6873
* Should now be able to send a query to your server before the connection
@@ -71,7 +76,7 @@
7176
* Bug Fixes
7277
* Should actually be able to query for longer than 5 seconds
7378

74-
## v0.4.4 (2018-02-09)
79+
## 0.4.4 (2018-02-09)
7580

7681
* Enhancements
7782
* Added support for using a mongo url via the `:url` key
@@ -86,7 +91,7 @@
8691
* Fixed an issue where our monitors would become empty, preventing the driver
8792
from reconnecting to a downed database
8893

89-
## v0.4.3 (2017-09-16)
94+
## 0.4.3 (2017-09-16)
9095

9196
* Enhancements
9297
* Send TLS server name indication (SNI) if none is set in the `:ssl_opts`
@@ -98,29 +103,29 @@
98103
* No longer attempting to authenticate against arbiter nodes
99104
* Prevent monitor errors if you have stopped the mongo process
100105

101-
## v0.4.2 (2017-08-28)
106+
## 0.4.2 (2017-08-28)
102107

103108
* Bug fixes
104109
* Fix application crash when a replica set member goes offline
105110
* Fix application crash on start when a replica set member is offline
106111

107-
## v0.4.1 (2017-08-09)
112+
## 0.4.1 (2017-08-09)
108113

109114
* Bug fixes
110115
* Monitors no longer use a pool
111116
* Can now connect to a Mongo instance using a CNAME
112117
* Pass options through Mongo.aggregate/4
113118

114-
## v0.4.0 (2017-06-07)
119+
## 0.4.0 (2017-06-07)
115120

116121
* Replica Set Support
117122

118-
## v0.3.0 (2017-05-11)
123+
## 0.3.0 (2017-05-11)
119124

120125
* Breaking changes
121126
* Remove `BSON.DateTime` and replace it with native Elixir `DateTime`
122127

123-
## v0.2.1 (2017-05-08)
128+
## 0.2.1 (2017-05-08)
124129

125130
* Enhancements
126131
* SSL support
@@ -129,7 +134,7 @@
129134
* Changes
130135
* Requires Elixir ~> 1.3
131136

132-
## v0.2.0 (2016-11-11)
137+
## 0.2.0 (2016-11-11)
133138

134139
* Enhancements
135140
* Add `BSON.ObjectID.encode!/1` and `BSON.ObjectID.decode!/1`
@@ -149,7 +154,7 @@
149154
* Breaking changes
150155
* Switched to using `db_connection` library, see the current docs for changes
151156

152-
## v0.1.1 (2015-12-17)
157+
## 0.1.1 (2015-12-17)
153158

154159
* Enhancements
155160
* Add `BSON.DateTime.from_datetime/1`
@@ -158,6 +163,6 @@
158163
* Fix timestamp epoch in generated object ids
159164
* Fix `Mongo.run_command/3` to accept errors without code
160165

161-
## v0.1.0 (2015-08-25)
166+
## 0.1.0 (2015-08-25)
162167

163168
Initial release

lib/mongo/mongo_db_connection.ex

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ defmodule Mongo.MongoDBConnection do
144144
_ -> "??"
145145
end
146146

147-
[architecture, name | _rest] = String.split(to_string(:erlang.system_info(:system_architecture)), "-")
147+
{architecture, name} = get_architecture()
148148

149149
version = case :os.version() do
150150
{one, two, tree} -> to_string(one) <> "." <> to_string(two) <> "." <> to_string(tree)
@@ -172,6 +172,15 @@ defmodule Mongo.MongoDBConnection do
172172
}
173173
end
174174

175+
defp get_architecture() do
176+
case String.split(to_string(:erlang.system_info(:system_architecture)), "-") do
177+
[architecture, name | _rest] -> {architecture, name}
178+
["win32"] -> {"win32", "Windows"}
179+
[one] -> {"??", one}
180+
[] -> {"??", "??"}
181+
end
182+
end
183+
175184
defp pretty_name("apple"), do: "Mac OS X"
176185
defp pretty_name(name), do: name
177186

0 commit comments

Comments
 (0)