Skip to content

Commit 1536afe

Browse files
committed
Misc doc changes
Besides other documentation changes, this commit ensures the generated HTML doc for HexDocs.pm will become the source of truth for this Elixir library and leverage on latest features of ExDoc.
1 parent 9d0f8cf commit 1536afe

19 files changed

+186
-163
lines changed

.formatter.exs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Used by "mix format"
2+
[
3+
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
4+
]

.gitignore

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
1-
_build/
2-
doc/
3-
deps/
1+
# The directory Mix will write compiled artifacts to.
2+
/_build/
3+
4+
# If you run "mix test --cover", coverage assets end up here.
5+
/cover/
6+
7+
# The directory Mix downloads your dependencies sources to.
8+
/deps/
9+
10+
# Where third-party dependencies like ExDoc output generated docs.
11+
/doc/
12+
13+
# Ignore .fetch files in case you like to edit your project deps locally.
14+
/.fetch
15+
16+
# If the VM crashes, it generates a dump, let's ignore it too.
417
erl_crash.dump
18+
19+
# Also ignore archive artifacts (built via "mix archive.build").
520
*.ez
6-
tmp/
7-
.tool-versions
8-
.elixir_ls
9-
plt_core_path/*.plt
10-
.idea/
11-
*.iml
12-
*.code-workspace
13-
data/
21+
22+
# Ignore package tarball (built via "mix hex.build").
23+
mongodb_driver-*.tar
24+
25+
# Temporary files, for example, from tests.
26+
/tmp/

CHANGELOG.md

Lines changed: 53 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,45 @@
1-
## 0.8.0 (0.7.5 was not published)
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
9+
## 0.8.0 (2021-11-07) (0.7.5 was not published)
210
* Enhancements
311
* replica set connection: faster topology update if the primary is down (thanks to p-mongo)
412
* added custom `Mongo.Encoder` protocol (thanks to esse)
513
* added collection from yildun project
614
* fixed an issue that the bulk operation does not stop after any insert/update/delete failed (thanks to ja-jimenez)
715

8-
## 0.7.4
16+
## 0.7.4 (2021-06-21)
917
* Enhancements
10-
* added a new option to specify a timeout, when increasing the connction pool is no option
18+
* added a new option to specify a timeout, when increasing the connection pool is no option
1119

12-
## 0.7.3
20+
## 0.7.3 (2021-05-29)
1321

1422
* Enhancements
1523
* added support for OTP 24
1624
* Add support for tls setting in connection string (tschmittni)
1725
* Replace deprecated functions (OTP 24) (aenglisc )
18-
19-
## 0.7.2
26+
27+
## 0.7.2 (2021-05-19)
2028

2129
* Enhancements
2230
* Adds test to cover one of Mongo.find/4 errors (vukanac)
2331
* Update specs for Mongo.find/4 with error tuple (vukanac)
2432
* Fix build warnings and correct typespec (joeapearson)
2533
* Update db_connection version to remove System.stacktrace warnings (vukanac)
2634
* Update SCRAM auth procedure (LetThereBeDwight)
27-
28-
## 0.7.1
35+
36+
## 0.7.1 (2021-01-01)
2937

3038
* Enhancements
3139
* upgraded decimal to 2.0, jason to 1.2
3240
* Add proper support for tailable cursors and awaitData (PR #74)
3341

34-
## 0.7.0
42+
## 0.7.0 (2020-04-17)
3543

3644
* Enhancements
3745
* refactored event notification system
@@ -44,43 +52,43 @@
4452
* Bugfixes
4553
* Using `max_staleness_ms` > 0 results in a crash
4654
* Read preferences are sent to mongos
47-
48-
## 0.6.5
55+
56+
## 0.6.5 (2020-03-30)
4957

5058
* Enhancements
5159
* updated db_connection dependency
5260
* generalize inconsistent typespecs
5361
* new function `BSON.ObjectId.decode/1` and `BSON.ObjectId.encode/1`
54-
* new function `Mongo.uuid/1`
55-
56-
## 0.6.4
62+
* new function `Mongo.uuid/1`
63+
64+
## 0.6.4 (2020-01-24)
5765

5866
* Bugfixes
59-
* fixed bug in `Mongo.TopologyDescription` in case of a shard cluster deployment (#39)
60-
61-
## 0.6.3
67+
* fixed bug in `Mongo.TopologyDescription` in case of a shard cluster deployment (#39)
68+
69+
## 0.6.3 (2020-01-23)
6270

6371
* Enhancements
6472
* basic support for inserting structs
6573
* removed duplicated code
6674
* Cursor-API raises a `Mongo.Error` instead of a `FunctionClauseError`
67-
75+
6876
* Bugfixes
6977
* `:appname` option (typo) #38
7078
* fixed index creation in `Mongo.GridFs.Bucket`
71-
72-
## 0.6.2
79+
80+
## 0.6.2 (2019-11-15)
7381

7482
* Enhancements
75-
* refactored the api of `Mongo.limits` and `Mongo.wire_version`
83+
* refactored the api of `Mongo.limits` and `Mongo.wire_version`
7684
* add support for tracking recovery token from response in a sharded transaction
77-
78-
## 0.6.1
85+
86+
## 0.6.1 (2019-11-01)
7987

8088
* Enhancements
8189
* refactored `Mongo.Session` and `Mongo.Session.SessionPool` because of poor performance
82-
83-
## 0.6.0
90+
91+
## 0.6.0 (2019-09-18)
8492

8593
* Enhancements
8694
* refactored `writeConcern`
@@ -90,59 +98,59 @@
9098
* added support for transaction
9199
* added Decimal128 encoder
92100
* added support for transaction to gridfs and bulk operation
93-
* added `create` command (explicitly creating a collection or view)
94-
95-
## 0.5.7
101+
* added `create` command (explicitly creating a collection or view)
102+
103+
## 0.5.7 (2019-06-25)
96104

97105
* Bug Fixes
98106
* Test for existing index in `Bucket` works right now
99107

100108
* Enhancements
101-
* Better handling for the `:timeout` options
109+
* Better handling for the `:timeout` options
102110

103-
## 0.5.6
111+
## 0.5.6 (2019-06-14)
104112

105113
* Bug Fixes
106114
* Fixed a match error in `after_fun` of cursor module
107-
* Fixed a match error in the result of function `Monitor.force_check`
115+
* Fixed a match error in the result of function `Monitor.force_check`
108116
* Resolved decode problem for the Binary (Old) BinData subtype
109-
117+
110118
* Enhancements
111119
* Added support for `Mongo.BulkWriteResult`
112120

113-
## 0.5.5
121+
## 0.5.5 (2019-05-22)
114122

115123
* Bug Fixes
116124
* Fixed a match error when using Windows OS
117-
118-
## 0.5.4
125+
126+
## 0.5.4 (2019-05-21)
119127

120128
* Enhancements
121-
* The driver provides now client metadata
129+
* The driver provides now client metadata
122130
* Added support for connecting via UNIX sockets (`:socket` and `:socket_dir`)
123131
* Added support for bulk writes (ordered/unordered, in-memory/stream)
124-
* Added support for `op_msg` with payload type 1
132+
* Added support for `op_msg` with payload type 1
125133
* Merged code from https://github.com/ankhers/mongodb/commit/63c20ff7e427744a5df915751adfaf6e5e39ae62
126134
* Merged changes from https://github.com/ankhers/mongodb/pull/283
127135
* Merged changes from https://github.com/ankhers/mongodb/pull/281
128136

129-
## 0.5.3
137+
## 0.5.3 (2019-05-02)
130138

131139
* Enhancements
132140
* Travis now using the right MongoDB version
133-
141+
134142
* Bug Fixes
135143
* Added test unit for change streams
136144
* Removed debug code from change streams
137145

138-
## 0.5.2
146+
## 0.5.2 (2019-05-01)
139147

140148
* Enhancements
141149
* Added `op_msg` support ([See](https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-msg))
142150
* Fixed change streams in case of error codes: 11601, 136 and 237 from resuming
143-
* Reorganized error handling
144-
145-
## 0.5.1
151+
* Reorganized error handling
152+
153+
## 0.5.1 (2019-04-28)
146154

147155
* Enhancements
148156
* Upgraded to DBConnection 2.0.6
@@ -166,14 +174,14 @@
166174
* Properly parse write concern for URL
167175
* Properly follow read preference for `secondary_preferred`
168176

169-
## 0.4.7
177+
## v0.4.7 (2018-09-13)
170178

171179
* Enhancements
172180
* Added 4.0 to supported versions
173181
* Initial support for mongodb+srv URLs
174182
* Support for Decimal128
175183

176-
## 0.4.6
184+
## v0.4.6 (2018-05-20)
177185

178186
* Enhancements
179187
* Added `:connect_timout_ms` to `Mongo.start_link/1`

LICENSE

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -174,28 +174,3 @@
174174
of your accepting any such warranty or additional liability.
175175

176176
END OF TERMS AND CONDITIONS
177-
178-
APPENDIX: How to apply the Apache License to your work.
179-
180-
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "[]"
182-
replaced with your own identifying information. (Don't include
183-
the brackets!) The text should be enclosed in the appropriate
184-
comment syntax for the file format. We also recommend that a
185-
file or class name and description of purpose be included on the
186-
same "printed page" as the copyright notice for easier
187-
identification within third-party archives.
188-
189-
Copyright [yyyy] [name of copyright owner]
190-
191-
Licensed under the Apache License, Version 2.0 (the "License");
192-
you may not use this file except in compliance with the License.
193-
You may obtain a copy of the License at
194-
195-
http://www.apache.org/licenses/LICENSE-2.0
196-
197-
Unless required by applicable law or agreed to in writing, software
198-
distributed under the License is distributed on an "AS IS" BASIS,
199-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200-
See the License for the specific language governing permissions and
201-
limitations under the License.

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22

33
[![Build Status](https://travis-ci.org/zookzook/elixir-mongodb-driver.svg?branch=master)](https://travis-ci.org/zookzook/elixir-mongodb-driver)
44
[![Hex.pm](https://img.shields.io/hexpm/v/mongodb_driver.svg)](https://hex.pm/packages/mongodb_driver)
5+
[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/mongo_driver/)
56
[![Hex.pm](https://img.shields.io/hexpm/dt/mongodb_driver.svg)](https://hex.pm/packages/mongodb_driver)
67
[![Hex.pm](https://img.shields.io/hexpm/dw/mongodb_driver.svg)](https://hex.pm/packages/mongodb_driver)
78
[![Hex.pm](https://img.shields.io/hexpm/dd/mongodb_driver.svg)](https://hex.pm/packages/mongodb_driver)
9+
[![License](https://img.shields.io/hexpm/l/mongodb_driver.svg)](https://github.com/zookzook/elixir-mongodb-driver/blob/master/LICENSE)
10+
[![Last Updated](https://img.shields.io/github/last-commit/zookzook/elixir-mongodb-driver.svg)](https://github.com/zookzook/elixir-mongodb-driver/commits/master)
811

912
## Features
1013

@@ -108,7 +111,7 @@ While using the `Mongo.Encoder` protocol give you the possibility to encode your
108111
* support for derived values
109112

110113
When using the MongoDB driver only maps and keyword lists are used to represent documents.
111-
If you would prefere to use structs instead of the maps to give the document a stronger meaning or to emphasize
114+
If you would prefer to use structs instead of the maps to give the document a stronger meaning or to emphasize
112115
its importance, you have to create a `defstruct` and fill it from the map manually:
113116

114117
```elixir
@@ -149,7 +152,7 @@ convert manually, too. If you take a closer look at the necessary work, two basi
149152
```elixir
150153
defmodule Label do
151154
use Mongo.Collection
152-
155+
153156
document do
154157
attribute :name, String.t(), default: "warning"
155158
attribute :color, String.t(), default: :red
@@ -162,9 +165,9 @@ This results in the following module:
162165
defmodule Label do
163166

164167
defstruct [name: "warning", color: "red"]
165-
168+
166169
@type t() :: %Label{String.t(), String.t()}
167-
170+
168171
def new()...
169172
def load(map)...
170173
def dump(%Label{})...
@@ -201,9 +204,9 @@ iex(3)> Label.load(m, true)
201204
%Label{color: nil, name: nil}
202205
```
203206

204-
The background is that MongoDB always returns binarys as keys and structs use atoms as keys.
207+
The background is that MongoDB always returns binarys as keys and structs use atoms as keys.
205208

206-
For more information look at the module documentation [Mongo.Collection](https://hexdocs.pm/mongodb_driver/Mongo.Collection.html#content).
209+
For more information look at the module documentation [Mongo.Collection](https://hexdocs.pm/mongodb_driver/Mongo.Collection.html#content).
207210

208211
Of course, using the `Mongo.Collection` is not free. When loading and saving, the maps are converted into structures, which increases CPU usage somewhat. When it comes to speed, it is better to use the maps directly.
209212

@@ -593,7 +596,7 @@ iex> Mongo.find_one(conn, "test", %{})
593596
[info] Received command: %Mongo.Events.CommandSucceededEvent{command_name: :find, ...
594597
```
595598

596-
## Testing
599+
## Testing
597600

598601
Latest MongoDB is used while running the tests. Replica set of three nodes is created and runs all test except the socket and ssl test. If you want to
599602
run the test cases against other MongoDB deployments or older versions, you can use the [mtools](https://github.com/rueckstiess/mtools) for deployment and run the test cases locally:
@@ -634,17 +637,14 @@ bulk operations.
634637

635638
Special thanks to [JetBrains](https://www.jetbrains.com/?from=elixir-mongodb-driver) for providing a free JetBrains Open Source license for their complete toolbox.
636639

637-
## License
638-
639-
Copyright 2015 Eric Meadows-Jönsson and Justin Wood
640+
## Copyright and License
640641

642+
Copyright 2015 Eric Meadows-Jönsson and Justin Wood \
641643
Copyright 2019 - 2021 Michael Maier
642644

643645
Licensed under the Apache License, Version 2.0 (the "License");
644646
you may not use this file except in compliance with the License.
645-
You may obtain a copy of the License at
646-
647-
http://www.apache.org/licenses/LICENSE-2.0
647+
You may obtain a copy of the License at [https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0)
648648

649649
Unless required by applicable law or agreed to in writing, software
650650
distributed under the License is distributed on an "AS IS" BASIS,

examples/change_stream/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This project shows a change stream example. You need to set up a replica set, be
55
* https://www.mongodb.com/blog/post/an-introduction-to-change-streams
66
* https://docs.mongodb.com/manual/changeStreams/
77

8-
If you creating a new replica set then you need to create the database `db-1` first, before starting the example. Otherwise you will get some errors, because the database which we will observe does not exsists.
8+
If you creating a new replica set then you need to create the database `db-1` first, before starting the example. Otherwise you will get some errors, because the database which we will observe does not exists.
99

1010
The `ChangeStream` module uses a GenServer for observing changes. It spawns a process to consume the documents returned by the change stream cursor:
1111

examples/crud_example/lib/crud_example.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ defmodule CrudExample do
1010
mobile: "+49 222192938383",
1111
fax: "+49 3332929292"
1212
},
13-
addess: %{
13+
address: %{
1414
street: "Fasanenweg 5",
1515
postal_code: "12345",
1616
city: "Berlin",

0 commit comments

Comments
 (0)