mongodb 2.2.36 → 3.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +24 -10
- package/CHANGES_3.0.0.md +288 -0
- package/HISTORY.md +120 -25
- package/README.md +247 -176
- package/conf.json +15 -14
- package/index.js +12 -6
- package/lib/admin.js +156 -364
- package/lib/aggregation_cursor.js +86 -88
- package/lib/apm.js +192 -149
- package/lib/authenticate.js +73 -53
- package/lib/bulk/common.js +140 -115
- package/lib/bulk/ordered.js +273 -195
- package/lib/bulk/unordered.js +291 -201
- package/lib/change_stream.js +359 -0
- package/lib/collection.js +1128 -1368
- package/lib/command_cursor.js +100 -73
- package/lib/cursor.js +454 -358
- package/lib/db.js +775 -771
- package/lib/gridfs/chunk.js +38 -34
- package/lib/gridfs/grid_store.js +590 -593
- package/lib/gridfs-stream/download.js +46 -40
- package/lib/gridfs-stream/index.js +24 -45
- package/lib/gridfs-stream/upload.js +28 -26
- package/lib/metadata.js +22 -16
- package/lib/mongo_client.js +708 -285
- package/lib/topologies/mongos.js +444 -0
- package/lib/topologies/replset.js +501 -0
- package/lib/topologies/server.js +448 -0
- package/lib/topologies/topology_base.js +441 -0
- package/lib/url_parser.js +334 -257
- package/lib/utils.js +210 -132
- package/package.json +20 -32
- package/yarn.lock +3728 -0
- package/lib/mongos.js +0 -533
- package/lib/read_preference.js +0 -131
- package/lib/replset.js +0 -582
- package/lib/server.js +0 -518
- package/lib/topology_base.js +0 -191
package/.eslintrc
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": [
|
|
2
|
+
"extends": [
|
|
3
|
+
"eslint:recommended"
|
|
4
|
+
],
|
|
3
5
|
"env": {
|
|
4
6
|
"node": true,
|
|
5
7
|
"mocha": true
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
},
|
|
9
|
+
"globals": {
|
|
10
|
+
"Promise": true
|
|
11
|
+
},
|
|
12
|
+
"parserOptions": {
|
|
13
|
+
"ecmaVersion": 2017
|
|
14
|
+
},
|
|
15
|
+
"plugins": [
|
|
16
|
+
"prettier"
|
|
17
|
+
],
|
|
18
|
+
"rules": {
|
|
19
|
+
"prettier/prettier": ["error", {
|
|
20
|
+
"singleQuote": true,
|
|
21
|
+
"tabWidth": 2,
|
|
22
|
+
"printWidth": 100
|
|
23
|
+
}],
|
|
24
|
+
|
|
25
|
+
"no-console": 0,
|
|
26
|
+
"eqeqeq": ["error", "always", {"null": "ignore"}],
|
|
27
|
+
"strict": ["error", "global"]
|
|
28
|
+
}
|
|
15
29
|
}
|
package/CHANGES_3.0.0.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
## Features
|
|
2
|
+
|
|
3
|
+
The following are new features added in MongoDB 3.6 and supported in the Node.js driver.
|
|
4
|
+
|
|
5
|
+
### Retryable Writes
|
|
6
|
+
|
|
7
|
+
Support has been added for retryable writes through the connection string. MongoDB 3.6
|
|
8
|
+
will utilize server sessions to allow some write commands to specify a transaction ID to enforce
|
|
9
|
+
at-most-once semantics for the write operation(s) and allow for retrying the operation if the driver
|
|
10
|
+
fails to obtain a write result (e.g. network error or "not master" error after a replica set
|
|
11
|
+
failover)Full details can be found in the [Retryable Writes Specification](https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.rst).
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### DNS Seedlist Support
|
|
15
|
+
|
|
16
|
+
Support has been added for DNS Seedlists. Users may now configure a single domain to return a list
|
|
17
|
+
of host names. Full details can be found in the [Seedlist Discovery Specification](https://github.com/mongodb/specifications/blob/master/source/initial-dns-seedlist-discovery/initial-dns-seedlist-discovery.rst).
|
|
18
|
+
|
|
19
|
+
### Change Streams
|
|
20
|
+
|
|
21
|
+
Support has been added for creating a stream to track changes to a particular collection. This is a
|
|
22
|
+
new feature in MongoDB 3.6. Full details can be found in the [Change Stream Specification](https://github.com/mongodb/specifications/blob/master/source/change-streams.rst) as
|
|
23
|
+
well as [examples in the test directory](https://github.com/mongodb/node-mongodb-native/blob/3.0.0/test/functional/operation_changestream_example_tests.js).
|
|
24
|
+
|
|
25
|
+
### Sessions
|
|
26
|
+
|
|
27
|
+
Version 3.6 of the server introduces the concept of logical sessions for clients. In this driver,
|
|
28
|
+
`MongoClient` now tracks all sessions created on the client, and explicitly cleans them up upon
|
|
29
|
+
client close. More information can be found in the [Driver Sessions Specification](https://github.com/mongodb/specifications/blob/master/source/sessions/driver-sessions.rst).
|
|
30
|
+
|
|
31
|
+
## API Changes
|
|
32
|
+
|
|
33
|
+
We removed the following API methods.
|
|
34
|
+
|
|
35
|
+
- `Db.prototype.authenticate`
|
|
36
|
+
- `Db.prototype.logout`
|
|
37
|
+
- `Db.prototype.open`
|
|
38
|
+
- `Db.prototype.db`
|
|
39
|
+
- `Db.prototype.close`
|
|
40
|
+
- `Admin.prototype.authenticate`
|
|
41
|
+
- `Admin.prototype.logout`
|
|
42
|
+
- `Admin.prototype.profilingLevel`
|
|
43
|
+
- `Admin.prototype.setProfilingLevel`
|
|
44
|
+
- `Admin.prototype.profilingInfo`
|
|
45
|
+
- `Cursor.prototype.nextObject`
|
|
46
|
+
|
|
47
|
+
We've added the following API methods.
|
|
48
|
+
- `MongoClient.prototype.logout`
|
|
49
|
+
- `MongoClient.prototype.isConnected`
|
|
50
|
+
- `MongoClient.prototype.db`
|
|
51
|
+
- `MongoClient.prototype.close`
|
|
52
|
+
- `MongoClient.prototype.connect`
|
|
53
|
+
- `Db.prototype.profilingLevel`
|
|
54
|
+
- `Db.prototype.setProfilingLevel`
|
|
55
|
+
- `Db.prototype.profilingInfo`
|
|
56
|
+
|
|
57
|
+
In core we have removed the possibility of authenticating multiple credentials against the same
|
|
58
|
+
connection pool. This is to avoid problems with MongoDB 3.6 or higher where all users will reside in
|
|
59
|
+
the admin database and thus database level authentication is no longer supported.
|
|
60
|
+
|
|
61
|
+
The legacy construct
|
|
62
|
+
|
|
63
|
+
```js
|
|
64
|
+
var db = var Db('test', new Server('localhost', 27017));
|
|
65
|
+
db.open((err, db) => {
|
|
66
|
+
// Authenticate
|
|
67
|
+
db.admin().authenticate('root', 'root', (err, success) => {
|
|
68
|
+
....
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
is replaced with
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
new MongoClient(new Server('localhost', 27017), {
|
|
77
|
+
user: 'root'
|
|
78
|
+
, password: 'root'
|
|
79
|
+
, authSource: 'adming'}).connect((err, client) => {
|
|
80
|
+
....
|
|
81
|
+
})
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`MongoClient.connect` works as expected but it returns the MongoClient instance instead of a
|
|
85
|
+
database object.
|
|
86
|
+
|
|
87
|
+
The legacy operation
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
MongoClient.connect('mongodb://localhost:27017/test', (err, db) => {
|
|
91
|
+
// Database returned
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
is replaced with
|
|
96
|
+
|
|
97
|
+
```js
|
|
98
|
+
MongoClient.connect('mongodb://localhost:27017/test', (err, client) => {
|
|
99
|
+
// Client returned
|
|
100
|
+
var db = client.db('test');
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Other Changes
|
|
105
|
+
|
|
106
|
+
Below are more updates to the driver in the 3.0.0 release.
|
|
107
|
+
|
|
108
|
+
### Connection String
|
|
109
|
+
|
|
110
|
+
Following [changes to the MongoDB connection string specification](https://github.com/mongodb/specifications/commit/4631ccd4f825fb1a3aba204510023f9b4d193a05),
|
|
111
|
+
authentication and hostname details in connection strings must now be URL-encoded. These changes
|
|
112
|
+
reduce ambiguity in connection strings.
|
|
113
|
+
|
|
114
|
+
For example, whereas before `mongodb://u$ername:pa$$w{}rd@/tmp/mongodb-27017.sock/test` would have
|
|
115
|
+
been a valid connection string (with username `u$ername`, password `pa$$w{}rd`, host `/tmp/mongodb-27017.sock`
|
|
116
|
+
and auth database `test`), the connection string for those details would now have to be provided to
|
|
117
|
+
MongoClient as `mongodb://u%24ername:pa%24%24w%7B%7Drd@%2Ftmp%2Fmongodb-27017.sock/test`.
|
|
118
|
+
|
|
119
|
+
Unsupported URL options in a connection string now log a warning instead of throwing an error.
|
|
120
|
+
|
|
121
|
+
For more information about connection strings, read the [connection string specification](https://github.com/mongodb/specifications/blob/master/source/connection-string/connection-string-spec.rst).
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### `BulkWriteResult` & `BulkWriteError`
|
|
125
|
+
|
|
126
|
+
When errors occured with bulk write operations in the past, the driver would callback or reject with
|
|
127
|
+
the first write error, as well as passing the resulting `BulkWriteResult`. For example:
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
MongoClient.connect('mongodb://localhost', function(err, client) {
|
|
131
|
+
const collection = client.db('foo').collection('test-collection')
|
|
132
|
+
|
|
133
|
+
collection
|
|
134
|
+
.insert({ id: 1 })
|
|
135
|
+
.then(() => collection.insertMany([ { id: 1 }, { id: 1 } ]))
|
|
136
|
+
.then(result => /* deal with errors in `result */)
|
|
137
|
+
.catch(err => /* no error is thrown for bulk errors */);
|
|
138
|
+
});
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
becomes:
|
|
142
|
+
|
|
143
|
+
```js
|
|
144
|
+
MongoClient.connect('mongodb://localhost', function(err, client) {
|
|
145
|
+
const collection = client.db('foo').collection('test-collection')
|
|
146
|
+
|
|
147
|
+
collection
|
|
148
|
+
.insert({ id: 1 })
|
|
149
|
+
.then(() => collection.insertMany([ { id: 1 }, { id: 1 } ]))
|
|
150
|
+
.then(() => /* this will not be called in the event of a bulk write error */)
|
|
151
|
+
.catch(err => /* deal with errors in `err` */);
|
|
152
|
+
});
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Where the result of the failed operation is a `BulkWriteError` which has a child value `result`
|
|
156
|
+
which is the original `BulkWriteResult`. Similarly, the callback form no longer calls back with an
|
|
157
|
+
`(Error, BulkWriteResult)`, but instead just a `(BulkWriteError)`.
|
|
158
|
+
|
|
159
|
+
### `mapReduce` inlined results
|
|
160
|
+
|
|
161
|
+
When `Collection.prototype.mapReduce` is invoked with a callback that includes `out: 'inline'`,
|
|
162
|
+
it would diverge from the `Promise`-based variant by returning additional data as positional
|
|
163
|
+
arguments to the callback (`(err, result, stats, ...)`). This is no longer the case, both variants
|
|
164
|
+
of the method will now return a single object for all results - a single value for the default case,
|
|
165
|
+
and an object similar to the existing `Promise` form for cases where there is more data to pass to
|
|
166
|
+
the user.
|
|
167
|
+
|
|
168
|
+
### Find
|
|
169
|
+
|
|
170
|
+
`find` and `findOne` no longer support the `fields` parameter. You can achieve the same results as
|
|
171
|
+
the `fields` parameter by using `Cursor.prototype.project` or by passing the `projection` property
|
|
172
|
+
in on the options object . Additionally, `find` does not support individual options like `skip` and
|
|
173
|
+
`limit` as positional parameters. You must either pass in these parameters in the `options` object,
|
|
174
|
+
or add them via `Cursor` methods like `Cursor.prototype.skip`.
|
|
175
|
+
|
|
176
|
+
### `Collection.prototype.aggregate`
|
|
177
|
+
|
|
178
|
+
`Collection.prototype.aggregate` no longer accepts variadic arguments. While this
|
|
179
|
+
was originally added to improve compatibility with the mongo shell, it has never
|
|
180
|
+
been a documented feature, and has led to more bugs and maintenance burden.
|
|
181
|
+
Pipeline stages are now only accepted as an `Array` of stages as the first argument.
|
|
182
|
+
|
|
183
|
+
2.x syntax:
|
|
184
|
+
|
|
185
|
+
```js
|
|
186
|
+
collection.prototype.aggregate(
|
|
187
|
+
{$match: {a: 1}},
|
|
188
|
+
{$project: {b: 1, _id: 0}},
|
|
189
|
+
function (err, result) {
|
|
190
|
+
...
|
|
191
|
+
}
|
|
192
|
+
);
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
3.x syntax
|
|
196
|
+
|
|
197
|
+
```js
|
|
198
|
+
collection.prototype.aggregate(
|
|
199
|
+
[
|
|
200
|
+
{$match: {a: 1}},
|
|
201
|
+
{$project: {b: 1, _id: 0}}
|
|
202
|
+
],
|
|
203
|
+
function (err, cursor) {
|
|
204
|
+
...
|
|
205
|
+
}
|
|
206
|
+
);
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
`Collection.prototype.aggregate` now returns a cursor if a callback is provided. It used to return
|
|
210
|
+
the resulting documents which is the same as calling `cursor.toArray()` on the cursor we now pass to
|
|
211
|
+
the callback.
|
|
212
|
+
|
|
213
|
+
2.x syntax
|
|
214
|
+
|
|
215
|
+
```js
|
|
216
|
+
collection.prototype.aggregate(
|
|
217
|
+
[
|
|
218
|
+
{$match: {a: 1}},
|
|
219
|
+
{$project: {b: 1, _id: 0}}
|
|
220
|
+
],
|
|
221
|
+
function (err, result) {
|
|
222
|
+
console.log(result);
|
|
223
|
+
}
|
|
224
|
+
);
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
3.x syntax
|
|
228
|
+
|
|
229
|
+
```js
|
|
230
|
+
collection.prototype.aggregate(
|
|
231
|
+
[
|
|
232
|
+
{$match: {a: 1}},
|
|
233
|
+
{$project: {b: 1, _id: 0}}
|
|
234
|
+
],
|
|
235
|
+
function (err, cursor) {
|
|
236
|
+
cursor.toArray(function(err, result) {
|
|
237
|
+
console.log(result);
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
);
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Support added for `comment` in the aggregation command. Support also added for a `hint` field in the
|
|
244
|
+
aggregation `options`.
|
|
245
|
+
|
|
246
|
+
If you use aggregation and try to use the `explain` flag while you have a `readConcern` or
|
|
247
|
+
`writeConcern`, your query will now fail.
|
|
248
|
+
|
|
249
|
+
### `updateOne` & `updateMany`
|
|
250
|
+
|
|
251
|
+
The driver now ensures that updated documents contain atomic operators. For instance, if a user
|
|
252
|
+
tries to update an existing document but passes in no operations (such as `$set`, `$unset`, or
|
|
253
|
+
`$rename`), the driver will now error:
|
|
254
|
+
|
|
255
|
+
```js
|
|
256
|
+
|
|
257
|
+
let testCollection = db.collection('test');
|
|
258
|
+
testCollection.updateOne({_id: 'test'}, {});
|
|
259
|
+
// An error is returned: The update operation document must contain at least one atomic operator.
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### `keepAlive`
|
|
263
|
+
|
|
264
|
+
Wherever it occurs, the option `keepAlive` has been changed. `keepAlive` is now a boolean that enables/disables `keepAlive`, while `keepAliveInitialDelay` specifies how long to wait before initiating keepAlive. This brings the API in line with [NodeJS's socket api](https://nodejs.org/dist/latest-v9.x/docs/api/all.html#net_socket_setkeepalive_enable_initialdelay)
|
|
265
|
+
|
|
266
|
+
### `insertMany`
|
|
267
|
+
|
|
268
|
+
Now `insertMany` returns `insertedIds` in a map of the index of the inserted document to the id of the inserted document:
|
|
269
|
+
|
|
270
|
+
```js
|
|
271
|
+
{
|
|
272
|
+
"0": 2,
|
|
273
|
+
"1": 3
|
|
274
|
+
}
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Previously an array of ids was returned: `[ 2, 3 ]`. This change occurs with both ordered and unordered `insertMany` calls, see the [CRUD specifications](https://github.com/mongodb/specifications/blob/master/source/crud/crud.rst#results) for more details.
|
|
278
|
+
|
|
279
|
+
### `geoNear` command helper
|
|
280
|
+
|
|
281
|
+
The functionality of the geoNear command is duplicated elsewhere in the language, in the `$near`/`$nearSphere` query operators on unsharded collections, and in the `$geoNear` aggregation stage on all collections. Maintaining this command increases our test surface, and creates additional work when adding features that must be supported on all read commands. As a result, the command will be fully
|
|
282
|
+
removed in the MongoDB 4.0 release, and we are choosing to remove it in this
|
|
283
|
+
major release of the node driver.
|
|
284
|
+
|
|
285
|
+
### Tests
|
|
286
|
+
|
|
287
|
+
We have updated all of the tests to use [Mocha](https://mochajs.org) and a new test runner, [`mongodb-test-runner`](https://github.com/mongodb-js/mongodb-test-runner), which
|
|
288
|
+
sets up topologies for the test scenarios.
|
package/HISTORY.md
CHANGED
|
@@ -1,59 +1,154 @@
|
|
|
1
|
-
<a name="
|
|
2
|
-
## [
|
|
1
|
+
<a name="3.0.2"></a>
|
|
2
|
+
## [3.0.2](https://github.com/mongodb/node-mongodb-native/compare/v3.0.1...v3.0.2) (2018-01-29)
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
### Bug Fixes
|
|
6
6
|
|
|
7
|
-
* **
|
|
7
|
+
* **collection:** ensure dynamic require of `db` is wrapped in parentheses ([efa78f0](https://github.com/mongodb/node-mongodb-native/commit/efa78f0))
|
|
8
|
+
* **db:** only callback with MongoError NODE-1293 ([#1652](https://github.com/mongodb/node-mongodb-native/issues/1652)) ([45bc722](https://github.com/mongodb/node-mongodb-native/commit/45bc722))
|
|
9
|
+
* **topology base:** allow more than 10 event listeners ([#1630](https://github.com/mongodb/node-mongodb-native/issues/1630)) ([d9fb750](https://github.com/mongodb/node-mongodb-native/commit/d9fb750))
|
|
10
|
+
* **url parser:** preserve auth creds when composing conn string ([#1640](https://github.com/mongodb/node-mongodb-native/issues/1640)) ([eddca5e](https://github.com/mongodb/node-mongodb-native/commit/eddca5e))
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
### Features
|
|
11
14
|
|
|
12
|
-
* **
|
|
15
|
+
* **bulk:** forward 'checkKeys' option for ordered and unordered bulk operations ([421a6b2](https://github.com/mongodb/node-mongodb-native/commit/421a6b2))
|
|
16
|
+
* **collection:** expose `dbName` property of collection ([6fd05c1](https://github.com/mongodb/node-mongodb-native/commit/6fd05c1))
|
|
13
17
|
|
|
14
18
|
|
|
15
19
|
|
|
16
|
-
<a name="
|
|
17
|
-
## [
|
|
20
|
+
<a name="3.0.1"></a>
|
|
21
|
+
## [3.0.1](https://github.com/mongodb/node-mongodb-native/compare/v3.0.0...v3.0.1) (2017-12-24)
|
|
22
|
+
|
|
23
|
+
* update mongodb-core to 3.0.1
|
|
24
|
+
|
|
25
|
+
<a name="3.0.0"></a>
|
|
26
|
+
# [3.0.0](https://github.com/mongodb/node-mongodb-native/compare/v3.0.0-rc0...v3.0.0) (2017-12-24)
|
|
18
27
|
|
|
19
28
|
|
|
20
29
|
### Bug Fixes
|
|
21
30
|
|
|
22
|
-
* **
|
|
23
|
-
* **
|
|
24
|
-
* **import:** adds missing import to lib/authenticate.js ([10db9a2](https://github.com/mongodb/node-mongodb-native/commit/10db9a2))
|
|
25
|
-
* **list-collections:** ensure default of primary ReadPreference ([0935306](https://github.com/mongodb/node-mongodb-native/commit/0935306))
|
|
31
|
+
* **aggregate:** remove support for inline results for aggregate ([#1620](https://github.com/mongodb/node-mongodb-native/issues/1620)) ([84457ec](https://github.com/mongodb/node-mongodb-native/commit/84457ec))
|
|
32
|
+
* **topologies:** unify topologies connect API ([#1615](https://github.com/mongodb/node-mongodb-native/issues/1615)) ([0fb4658](https://github.com/mongodb/node-mongodb-native/commit/0fb4658))
|
|
26
33
|
|
|
27
34
|
|
|
28
35
|
### Features
|
|
29
36
|
|
|
30
|
-
* **
|
|
31
|
-
* **url parser:** add dns seedlist support ([2d357bc](https://github.com/mongodb/node-mongodb-native/commit/2d357bc))
|
|
32
|
-
* **core**: update mongodb-core to 2.1.18
|
|
37
|
+
* **keepAlive:** make keepAlive options consistent ([#1612](https://github.com/mongodb/node-mongodb-native/issues/1612)) ([f608f44](https://github.com/mongodb/node-mongodb-native/commit/f608f44))
|
|
33
38
|
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
-----------------
|
|
37
|
-
* update to mongodb-core 2.1.17
|
|
40
|
+
### BREAKING CHANGES
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
*
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
* **topologies:** Function signature for `.connect` method on replset and mongos has changed. You shouldn't have been using this anyway, but if you were, you only should pass `options` and `callback`.
|
|
43
|
+
|
|
44
|
+
Part of NODE-1089
|
|
45
|
+
* **keepAlive:** option `keepAlive` is now split into boolean `keepAlive` and
|
|
46
|
+
number `keepAliveInitialDelay`
|
|
47
|
+
|
|
48
|
+
Fixes NODE-998
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
<a name="3.0.0-rc0"></a>
|
|
53
|
+
# [3.0.0-rc0](https://github.com/mongodb/node-mongodb-native/compare/v2.2.31...v3.0.0-rc0) (2017-12-05)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
### Bug Fixes
|
|
57
|
+
|
|
58
|
+
* **aggregation:** ensure that the `cursor` key is always present ([f16f314](https://github.com/mongodb/node-mongodb-native/commit/f16f314))
|
|
59
|
+
* **apm:** give users access to raw server responses ([88b206b](https://github.com/mongodb/node-mongodb-native/commit/88b206b))
|
|
60
|
+
* **apm:** only rebuilt cursor if reply is non-null ([96052c8](https://github.com/mongodb/node-mongodb-native/commit/96052c8))
|
|
61
|
+
* **apm:** rebuild lost `cursor` info on pre-OP_QUERY responses ([4242d49](https://github.com/mongodb/node-mongodb-native/commit/4242d49))
|
|
62
|
+
* **bulk-unordered:** add check for ignoreUndefined ([f38641a](https://github.com/mongodb/node-mongodb-native/commit/f38641a))
|
|
63
|
+
* **change stream examples:** use timeouts, cleanup ([c5fec5f](https://github.com/mongodb/node-mongodb-native/commit/c5fec5f))
|
|
64
|
+
* **change-streams:** ensure a majority read concern on initial agg ([23011e9](https://github.com/mongodb/node-mongodb-native/commit/23011e9))
|
|
65
|
+
* **changeStreams:** fixing node4 issue with util.inherits ([#1587](https://github.com/mongodb/node-mongodb-native/issues/1587)) ([168bb3d](https://github.com/mongodb/node-mongodb-native/commit/168bb3d))
|
|
66
|
+
* **collection:** allow { upsert: 1 } for findOneAndUpdate() and update() ([5bcedd6](https://github.com/mongodb/node-mongodb-native/commit/5bcedd6))
|
|
67
|
+
* **collection:** allow passing `noCursorTimeout` as an option to `find()` ([e9c4ffc](https://github.com/mongodb/node-mongodb-native/commit/e9c4ffc))
|
|
68
|
+
* **collection:** make the parameters of findOne very explicit ([3054f1a](https://github.com/mongodb/node-mongodb-native/commit/3054f1a))
|
|
69
|
+
* **cursor:** `hasNext` should propagate errors when using callback ([6339625](https://github.com/mongodb/node-mongodb-native/commit/6339625))
|
|
70
|
+
* **cursor:** close readable on `null` response for dead cursor ([6aca2c5](https://github.com/mongodb/node-mongodb-native/commit/6aca2c5))
|
|
71
|
+
* **dns txt records:** check options are set ([e5caf4f](https://github.com/mongodb/node-mongodb-native/commit/e5caf4f))
|
|
72
|
+
* **docs:** Represent each valid option in docs in both places ([fde6e5d](https://github.com/mongodb/node-mongodb-native/commit/fde6e5d))
|
|
73
|
+
* **grid-store:** add missing callback ([66a9a05](https://github.com/mongodb/node-mongodb-native/commit/66a9a05))
|
|
74
|
+
* **grid-store:** move into callback scope ([b53f65f](https://github.com/mongodb/node-mongodb-native/commit/b53f65f))
|
|
75
|
+
* **GridFS:** fix TypeError: doc.data.length is not a function ([#1570](https://github.com/mongodb/node-mongodb-native/issues/1570)) ([22a4628](https://github.com/mongodb/node-mongodb-native/commit/22a4628))
|
|
76
|
+
* **list-collections:** ensure default of primary ReadPreference ([4a0cfeb](https://github.com/mongodb/node-mongodb-native/commit/4a0cfeb))
|
|
77
|
+
* **mongo client:** close client before calling done ([c828aab](https://github.com/mongodb/node-mongodb-native/commit/c828aab))
|
|
78
|
+
* **mongo client:** do not connect if url parse error ([cd10084](https://github.com/mongodb/node-mongodb-native/commit/cd10084))
|
|
79
|
+
* **mongo client:** send error to cb ([eafc9e2](https://github.com/mongodb/node-mongodb-native/commit/eafc9e2))
|
|
80
|
+
* **mongo-client:** move to inside of callback ([68b0fca](https://github.com/mongodb/node-mongodb-native/commit/68b0fca))
|
|
81
|
+
* **mongo-client:** options should not be passed to `connect` ([474ac65](https://github.com/mongodb/node-mongodb-native/commit/474ac65))
|
|
82
|
+
* **tests:** migrate 2.x tests to 3.x ([3a5232a](https://github.com/mongodb/node-mongodb-native/commit/3a5232a))
|
|
83
|
+
* **updateOne/updateMany:** ensure that update documents contain atomic operators ([8b4255a](https://github.com/mongodb/node-mongodb-native/commit/8b4255a))
|
|
84
|
+
* **url parser:** add check for options as cb ([52b6039](https://github.com/mongodb/node-mongodb-native/commit/52b6039))
|
|
85
|
+
* **url parser:** compare srv address and parent domains ([daa186d](https://github.com/mongodb/node-mongodb-native/commit/daa186d))
|
|
86
|
+
* **url parser:** compare string from first period on ([9e5d77e](https://github.com/mongodb/node-mongodb-native/commit/9e5d77e))
|
|
87
|
+
* **url parser:** default to ssl true for mongodb+srv ([0fbca4b](https://github.com/mongodb/node-mongodb-native/commit/0fbca4b))
|
|
88
|
+
* **url parser:** error when multiple hostnames used ([c1aa681](https://github.com/mongodb/node-mongodb-native/commit/c1aa681))
|
|
89
|
+
* **url parser:** keep original uri options and default to ssl true ([e876a72](https://github.com/mongodb/node-mongodb-native/commit/e876a72))
|
|
90
|
+
* **url parser:** log instead of throw error for unsupported url options ([155de2d](https://github.com/mongodb/node-mongodb-native/commit/155de2d))
|
|
91
|
+
* **url parser:** make sure uri has 3 parts ([aa9871b](https://github.com/mongodb/node-mongodb-native/commit/aa9871b))
|
|
92
|
+
* **url parser:** only 1 txt record allowed with 2 possible options ([d9f4218](https://github.com/mongodb/node-mongodb-native/commit/d9f4218))
|
|
93
|
+
* **url parser:** only check for multiple hostnames with srv protocol ([5542bcc](https://github.com/mongodb/node-mongodb-native/commit/5542bcc))
|
|
94
|
+
* **url parser:** remove .only from test ([642e39e](https://github.com/mongodb/node-mongodb-native/commit/642e39e))
|
|
95
|
+
* **url parser:** return callback ([6096afc](https://github.com/mongodb/node-mongodb-native/commit/6096afc))
|
|
96
|
+
* **url parser:** support single text record with multiple strings ([356fa57](https://github.com/mongodb/node-mongodb-native/commit/356fa57))
|
|
97
|
+
* **url parser:** try catch bug, not actually returning from try loop ([758892b](https://github.com/mongodb/node-mongodb-native/commit/758892b))
|
|
98
|
+
* **url parser:** use warn instead of info ([40ed27d](https://github.com/mongodb/node-mongodb-native/commit/40ed27d))
|
|
99
|
+
* **url-parser:** remove comment, send error to cb ([d44420b](https://github.com/mongodb/node-mongodb-native/commit/d44420b))
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
### Features
|
|
103
|
+
|
|
104
|
+
* **aggregate:** support hit field for aggregate command ([aa7da15](https://github.com/mongodb/node-mongodb-native/commit/aa7da15))
|
|
105
|
+
* **aggregation:** adds support for comment in aggregation command ([#1571](https://github.com/mongodb/node-mongodb-native/issues/1571)) ([4ac475c](https://github.com/mongodb/node-mongodb-native/commit/4ac475c))
|
|
106
|
+
* **aggregation:** fail aggregation on explain + readConcern/writeConcern ([e0ca1b4](https://github.com/mongodb/node-mongodb-native/commit/e0ca1b4))
|
|
107
|
+
* **causal-consistency:** support `afterClusterTime` in readConcern ([a9097f7](https://github.com/mongodb/node-mongodb-native/commit/a9097f7))
|
|
108
|
+
* **change-streams:** add support for change streams ([c02d25c](https://github.com/mongodb/node-mongodb-native/commit/c02d25c))
|
|
109
|
+
* **collection:** updating find API ([f26362d](https://github.com/mongodb/node-mongodb-native/commit/f26362d))
|
|
110
|
+
* **execute-operation:** implementation for common op execution ([67c344f](https://github.com/mongodb/node-mongodb-native/commit/67c344f))
|
|
111
|
+
* **listDatabases:** add support for nameOnly option to listDatabases ([eb79b5a](https://github.com/mongodb/node-mongodb-native/commit/eb79b5a))
|
|
112
|
+
* **maxTimeMS:** adding maxTimeMS option to createIndexes and dropIndexes ([90d4a63](https://github.com/mongodb/node-mongodb-native/commit/90d4a63))
|
|
113
|
+
* **mongo-client:** implement `MongoClient.prototype.startSession` ([bce5adf](https://github.com/mongodb/node-mongodb-native/commit/bce5adf))
|
|
114
|
+
* **retryable-writes:** add support for `retryWrites` cs option ([2321870](https://github.com/mongodb/node-mongodb-native/commit/2321870))
|
|
115
|
+
* **sessions:** MongoClient will now track sessions and release ([6829f47](https://github.com/mongodb/node-mongodb-native/commit/6829f47))
|
|
116
|
+
* **sessions:** support passing sessions via objects in all methods ([a531f05](https://github.com/mongodb/node-mongodb-native/commit/a531f05))
|
|
117
|
+
* **shared:** add helper utilities for assertion and suite setup ([b6cc34e](https://github.com/mongodb/node-mongodb-native/commit/b6cc34e))
|
|
118
|
+
* **ssl:** adds missing ssl options ssl options for `ciphers` and `ecdhCurve` ([441b7b1](https://github.com/mongodb/node-mongodb-native/commit/441b7b1))
|
|
119
|
+
* **test-shared:** add `notEqual` assertion ([41d93fd](https://github.com/mongodb/node-mongodb-native/commit/41d93fd))
|
|
120
|
+
* **test-shared:** add `strictEqual` assertion method ([cad8e19](https://github.com/mongodb/node-mongodb-native/commit/cad8e19))
|
|
121
|
+
* **topologies:** expose underlaying `logicalSessionTimeoutMinutes' ([1609a37](https://github.com/mongodb/node-mongodb-native/commit/1609a37))
|
|
122
|
+
* **url parser:** better error message for slash in hostname ([457bc29](https://github.com/mongodb/node-mongodb-native/commit/457bc29))
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
### BREAKING CHANGES
|
|
126
|
+
|
|
127
|
+
* **aggregation:** If you use aggregation, and try to use the explain flag while you
|
|
128
|
+
have a readConcern or writeConcern, your query will fail
|
|
129
|
+
* **collection:** `find` and `findOne` no longer support the `fields` parameter.
|
|
130
|
+
You can achieve the same results as the `fields` parameter by
|
|
131
|
+
either using `Cursor.prototype.project`, or by passing the `projection`
|
|
132
|
+
property in on the `options` object. Additionally, `find` does not
|
|
133
|
+
support individual options like `skip` and `limit` as positional
|
|
134
|
+
parameters. You must pass in these parameters in the `options` object
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
3.0.0 2017-??-??
|
|
139
|
+
----------------
|
|
140
|
+
* NODE-1043 URI-escaping authentication and hostname details in connection string
|
|
46
141
|
|
|
47
142
|
2.2.31 2017-08-08
|
|
48
143
|
-----------------
|
|
49
|
-
* update mongodb-core to 2.
|
|
144
|
+
* update mongodb-core to 2.2.15
|
|
50
145
|
* allow auth option in MongoClient.connect
|
|
51
146
|
* remove duplicate option `promoteLongs` from MongoClient's `connect`
|
|
52
147
|
* bulk operations should not throw an error on empty batch
|
|
53
148
|
|
|
54
149
|
2.2.30 2017-07-07
|
|
55
150
|
-----------------
|
|
56
|
-
* Update mongodb-core to 2.
|
|
151
|
+
* Update mongodb-core to 2.2.14
|
|
57
152
|
* MongoClient
|
|
58
153
|
* add `appname` to list of valid option names
|
|
59
154
|
* added test for passing appname as option
|