mongodb 3.3.0-beta2 → 3.3.3
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/HISTORY.md +155 -0
- package/index.js +1 -0
- package/lib/admin.js +6 -6
- package/lib/aggregation_cursor.js +180 -228
- package/lib/bulk/common.js +150 -73
- package/lib/bulk/ordered.js +1 -1
- package/lib/bulk/unordered.js +1 -0
- package/lib/change_stream.js +66 -66
- package/lib/collection.js +131 -44
- package/lib/command_cursor.js +87 -167
- package/lib/core/connection/connection.js +7 -3
- package/lib/core/connection/msg.js +5 -3
- package/lib/core/connection/pool.js +114 -143
- package/lib/core/cursor.js +569 -435
- package/lib/core/error.js +63 -12
- package/lib/core/index.js +1 -1
- package/lib/core/sdam/monitoring.js +8 -1
- package/lib/core/sdam/server.js +58 -14
- package/lib/core/sdam/topology.js +66 -31
- package/lib/core/sdam/topology_description.js +1 -1
- package/lib/core/sessions.js +68 -12
- package/lib/core/topologies/mongos.js +81 -26
- package/lib/core/topologies/replset.js +56 -10
- package/lib/core/topologies/replset_state.js +5 -5
- package/lib/core/topologies/server.js +7 -2
- package/lib/core/topologies/shared.js +23 -0
- package/lib/core/transactions.js +1 -0
- package/lib/core/uri_parser.js +8 -2
- package/lib/core/utils.js +13 -1
- package/lib/core/wireprotocol/get_more.js +4 -0
- package/lib/core/wireprotocol/query.js +8 -1
- package/lib/cursor.js +782 -844
- package/lib/db.js +27 -75
- package/lib/gridfs-stream/download.js +12 -5
- package/lib/gridfs-stream/index.js +1 -1
- package/lib/mongo_client.js +27 -11
- package/lib/operations/aggregate.js +75 -101
- package/lib/operations/close.js +12 -13
- package/lib/operations/collection_ops.js +3 -916
- package/lib/operations/command_v2.js +70 -4
- package/lib/operations/common_functions.js +48 -14
- package/lib/operations/connect.js +29 -36
- package/lib/operations/count.js +8 -8
- package/lib/operations/count_documents.js +24 -29
- package/lib/operations/cursor_ops.js +22 -32
- package/lib/operations/db_ops.js +0 -178
- package/lib/operations/estimated_document_count.js +43 -18
- package/lib/operations/execute_operation.js +51 -18
- package/lib/operations/explain.js +2 -2
- package/lib/operations/find.js +35 -0
- package/lib/operations/insert_one.js +1 -37
- package/lib/operations/list_collections.js +106 -0
- package/lib/operations/list_databases.js +38 -0
- package/lib/operations/list_indexes.js +28 -52
- package/lib/operations/operation.js +4 -0
- package/lib/operations/rename.js +1 -1
- package/lib/operations/replace_one.js +1 -1
- package/lib/operations/to_array.js +3 -5
- package/lib/read_concern.js +7 -1
- package/lib/topologies/mongos.js +1 -1
- package/lib/topologies/replset.js +1 -1
- package/lib/topologies/server.js +2 -2
- package/lib/topologies/topology_base.js +4 -5
- package/lib/utils.js +4 -4
- package/package.json +9 -5
- package/lib/operations/aggregate_operation.js +0 -127
package/HISTORY.md
CHANGED
|
@@ -2,6 +2,161 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
<a name="3.3.3"></a>
|
|
6
|
+
## [3.3.3](https://github.com/mongodb/node-mongodb-native/compare/v3.3.2...v3.3.3) (2019-10-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **change_stream:** emit 'close' event if reconnecting failed ([f24c084](https://github.com/mongodb/node-mongodb-native/commit/f24c084))
|
|
12
|
+
* **ChangeStream:** remove startAtOperationTime once we have resumeToken ([362afd8](https://github.com/mongodb/node-mongodb-native/commit/362afd8))
|
|
13
|
+
* **connect:** Switch new Buffer(size) -> Buffer.alloc(size) ([da90c3a](https://github.com/mongodb/node-mongodb-native/commit/da90c3a))
|
|
14
|
+
* **MongoClient:** only check own properties for valid options ([9cde4b9](https://github.com/mongodb/node-mongodb-native/commit/9cde4b9))
|
|
15
|
+
* **mongos:** disconnect proxies which are not mongos instances ([ee53983](https://github.com/mongodb/node-mongodb-native/commit/ee53983))
|
|
16
|
+
* **mongos:** force close servers during reconnect flow ([186263f](https://github.com/mongodb/node-mongodb-native/commit/186263f))
|
|
17
|
+
* **monitoring:** correct spelling mistake for heartbeat event ([21aa117](https://github.com/mongodb/node-mongodb-native/commit/21aa117))
|
|
18
|
+
* **replset:** correct server leak on initial connect ([da39d1e](https://github.com/mongodb/node-mongodb-native/commit/da39d1e))
|
|
19
|
+
* **replset:** destroy primary before removing from replsetstate ([45ac09a](https://github.com/mongodb/node-mongodb-native/commit/45ac09a))
|
|
20
|
+
* **replset:** destroy servers that are removed during SDAM flow ([9ea0190](https://github.com/mongodb/node-mongodb-native/commit/9ea0190))
|
|
21
|
+
* **saslprep:** add in missing saslprep dependency ([41f1165](https://github.com/mongodb/node-mongodb-native/commit/41f1165))
|
|
22
|
+
* **topology:** don't early abort server selection on network errors ([2b6a359](https://github.com/mongodb/node-mongodb-native/commit/2b6a359))
|
|
23
|
+
* **topology:** don't emit server closed event on network error ([194dcf0](https://github.com/mongodb/node-mongodb-native/commit/194dcf0))
|
|
24
|
+
* **topology:** include all BSON types in ctor for bson-ext support ([aa4c832](https://github.com/mongodb/node-mongodb-native/commit/aa4c832))
|
|
25
|
+
* **topology:** respect the `force` parameter for topology close ([d6e8936](https://github.com/mongodb/node-mongodb-native/commit/d6e8936))
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* **Update:** add the ability to specify a pipeline to an update command ([#2017](https://github.com/mongodb/node-mongodb-native/issues/2017)) ([44a4110](https://github.com/mongodb/node-mongodb-native/commit/44a4110))
|
|
30
|
+
* **urlParser:** default useNewUrlParser to true ([52d76e3](https://github.com/mongodb/node-mongodb-native/commit/52d76e3))
|
|
31
|
+
|
|
32
|
+
<a name="3.2.7"></a>
|
|
33
|
+
## [3.2.7](https://github.com/mongodb/node-mongodb-native/compare/v3.2.6...v3.2.7) (2019-06-04)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* **core:** updating core to version 3.2.7 ([2f91466](https://github.com/mongodb/node-mongodb-native/commit/2f91466))
|
|
39
|
+
* **findOneAndReplace:** throw error if atomic operators provided for findOneAndReplace ([6a860a3](https://github.com/mongodb/node-mongodb-native/commit/6a860a3))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
<a name="3.3.2"></a>
|
|
44
|
+
## [3.3.2](https://github.com/mongodb/node-mongodb-native/compare/v3.3.1...v3.3.2) (2019-08-28)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
* **change-stream:** default to server default batch size ([b3ae4c5](https://github.com/mongodb/node-mongodb-native/commit/b3ae4c5))
|
|
50
|
+
* **execute-operation:** return promise on session support check ([a976c14](https://github.com/mongodb/node-mongodb-native/commit/a976c14))
|
|
51
|
+
* **gridfs-stream:** ensure `close` is emitted after last chunk ([ae94cb9](https://github.com/mongodb/node-mongodb-native/commit/ae94cb9))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
<a name="3.3.1"></a>
|
|
56
|
+
## [3.3.1](https://github.com/mongodb/node-mongodb-native/compare/v3.3.0...v3.3.1) (2019-08-23)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Bug Fixes
|
|
60
|
+
|
|
61
|
+
* **find:** respect client-level provided read preference ([fec4f15](https://github.com/mongodb/node-mongodb-native/commit/fec4f15))
|
|
62
|
+
* correct inverted defaults for unified topology ([cf598e1](https://github.com/mongodb/node-mongodb-native/commit/cf598e1))
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
<a name="3.3.0"></a>
|
|
67
|
+
# [3.3.0](https://github.com/mongodb/node-mongodb-native/compare/v3.3.0-alpha1...v3.3.0) (2019-08-13)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### Bug Fixes
|
|
71
|
+
|
|
72
|
+
* **aggregate-operation:** move type assertions to constructor ([25b27ff](https://github.com/mongodb/node-mongodb-native/commit/25b27ff))
|
|
73
|
+
* **autoEncryption:** tear down mongocryptd client when main client closes ([fe2f57e](https://github.com/mongodb/node-mongodb-native/commit/fe2f57e))
|
|
74
|
+
* **autoEncryption:** use new url parser for autoEncryption client ([d3670c2](https://github.com/mongodb/node-mongodb-native/commit/d3670c2))
|
|
75
|
+
* **Bulk:** change BulkWriteError message to first item from writeErrors ([#2013](https://github.com/mongodb/node-mongodb-native/issues/2013)) ([6bcf1e4](https://github.com/mongodb/node-mongodb-native/commit/6bcf1e4))
|
|
76
|
+
* **change_stream:** emit 'close' event if reconnecting failed ([41aba90](https://github.com/mongodb/node-mongodb-native/commit/41aba90))
|
|
77
|
+
* **change_stream:** emit close event after cursor is closed during error ([c2d80b2](https://github.com/mongodb/node-mongodb-native/commit/c2d80b2))
|
|
78
|
+
* **change-streams:** don't copy irrelevant resume options ([f190072](https://github.com/mongodb/node-mongodb-native/commit/f190072))
|
|
79
|
+
* **changestream:** removes all event listeners on close ([30eeeb5](https://github.com/mongodb/node-mongodb-native/commit/30eeeb5))
|
|
80
|
+
* **ChangeStream:** remove startAtOperationTime once we have resumeToken ([8d27e6e](https://github.com/mongodb/node-mongodb-native/commit/8d27e6e))
|
|
81
|
+
* **ClientSessions:** initialize clientOptions and cluster time ([b95d64e](https://github.com/mongodb/node-mongodb-native/commit/b95d64e))
|
|
82
|
+
* **connect:** don't treat 'connect' as an error event ([170a011](https://github.com/mongodb/node-mongodb-native/commit/170a011))
|
|
83
|
+
* **connect:** fixed syntax issue in connect error handler ([ff7166d](https://github.com/mongodb/node-mongodb-native/commit/ff7166d))
|
|
84
|
+
* **connections_stepdown_tests:** use correct version of mongo for tests ([ce2c9af](https://github.com/mongodb/node-mongodb-native/commit/ce2c9af))
|
|
85
|
+
* **createCollection:** Db.createCollection should pass readConcern to new collection ([#2026](https://github.com/mongodb/node-mongodb-native/issues/2026)) ([6145d4b](https://github.com/mongodb/node-mongodb-native/commit/6145d4b))
|
|
86
|
+
* **cursor:** do not truncate an existing Long ([317055b](https://github.com/mongodb/node-mongodb-native/commit/317055b)), closes [mongodb-js/mongodb-core#441](https://github.com/mongodb-js/mongodb-core/issues/441)
|
|
87
|
+
* **distinct:** return full response if `full` option was specified ([95a7d05](https://github.com/mongodb/node-mongodb-native/commit/95a7d05))
|
|
88
|
+
* **MongoClient:** allow Object.prototype items as db names ([dc6fc37](https://github.com/mongodb/node-mongodb-native/commit/dc6fc37))
|
|
89
|
+
* **MongoClient:** only check own properties for valid options ([c9dc717](https://github.com/mongodb/node-mongodb-native/commit/c9dc717))
|
|
90
|
+
* **OpMsg:** cap requestIds at 0x7fffffff ([c0e87d5](https://github.com/mongodb/node-mongodb-native/commit/c0e87d5))
|
|
91
|
+
* **read-operations:** send sessions on all read operations ([4d45c8a](https://github.com/mongodb/node-mongodb-native/commit/4d45c8a))
|
|
92
|
+
* **ReadPreference:** improve ReadPreference error message and remove irrelevant sharding test ([dd34ce4](https://github.com/mongodb/node-mongodb-native/commit/dd34ce4))
|
|
93
|
+
* **ReadPreference:** only allow valid ReadPreference modes ([06bbef2](https://github.com/mongodb/node-mongodb-native/commit/06bbef2))
|
|
94
|
+
* **replset:** correct legacy max staleness calculation ([2eab8aa](https://github.com/mongodb/node-mongodb-native/commit/2eab8aa))
|
|
95
|
+
* **replset:** introduce a fixed-time server selection loop ([cf53299](https://github.com/mongodb/node-mongodb-native/commit/cf53299))
|
|
96
|
+
* **server:** emit "first connect" error if initial connect fails due to ECONNREFUSED ([#2016](https://github.com/mongodb/node-mongodb-native/issues/2016)) ([5a7b15b](https://github.com/mongodb/node-mongodb-native/commit/5a7b15b))
|
|
97
|
+
* **serverSelection:** make sure to pass session to serverSelection ([eb5cc6b](https://github.com/mongodb/node-mongodb-native/commit/eb5cc6b))
|
|
98
|
+
* **sessions:** ensure an error is thrown when attempting sharded transactions ([3a1fdc1](https://github.com/mongodb/node-mongodb-native/commit/3a1fdc1))
|
|
99
|
+
* **topology:** add new error for retryWrites on MMAPv1 ([392f5a6](https://github.com/mongodb/node-mongodb-native/commit/392f5a6))
|
|
100
|
+
* don't check non-unified topologies for session support check ([2bccd3f](https://github.com/mongodb/node-mongodb-native/commit/2bccd3f))
|
|
101
|
+
* maintain internal database name on collection rename ([884d46f](https://github.com/mongodb/node-mongodb-native/commit/884d46f))
|
|
102
|
+
* only check for transaction state if session exists ([360975a](https://github.com/mongodb/node-mongodb-native/commit/360975a))
|
|
103
|
+
* preserve aggregate explain support for legacy servers ([032b204](https://github.com/mongodb/node-mongodb-native/commit/032b204))
|
|
104
|
+
* read concern only supported for `mapReduce` without inline ([51a36f3](https://github.com/mongodb/node-mongodb-native/commit/51a36f3))
|
|
105
|
+
* reintroduce support for 2.6 listIndexes ([c3bfc05](https://github.com/mongodb/node-mongodb-native/commit/c3bfc05))
|
|
106
|
+
* return `executeOperation` for explain, if promise is desired ([b4a7ad7](https://github.com/mongodb/node-mongodb-native/commit/b4a7ad7))
|
|
107
|
+
* validate atomic operations in all update methods ([88bb77e](https://github.com/mongodb/node-mongodb-native/commit/88bb77e))
|
|
108
|
+
* **transactions:** fix error message for attempting sharded ([eb5dfc9](https://github.com/mongodb/node-mongodb-native/commit/eb5dfc9))
|
|
109
|
+
* **transactions:** fix sharded transaction error logic ([083e18a](https://github.com/mongodb/node-mongodb-native/commit/083e18a))
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
### Features
|
|
113
|
+
|
|
114
|
+
* **Aggregate:** support ReadConcern in aggregates with $out ([21cdcf0](https://github.com/mongodb/node-mongodb-native/commit/21cdcf0))
|
|
115
|
+
* **AutoEncryption:** improve error message for missing mongodb-client-encryption ([583f29f](https://github.com/mongodb/node-mongodb-native/commit/583f29f))
|
|
116
|
+
* **ChangeStream:** adds new resume functionality to ChangeStreams ([9ec9b8f](https://github.com/mongodb/node-mongodb-native/commit/9ec9b8f))
|
|
117
|
+
* **ChangeStreamCursor:** introduce new cursor type for change streams ([8813eb0](https://github.com/mongodb/node-mongodb-native/commit/8813eb0))
|
|
118
|
+
* **cryptdConnectionString:** makes mongocryptd uri configurable ([#2049](https://github.com/mongodb/node-mongodb-native/issues/2049)) ([a487be4](https://github.com/mongodb/node-mongodb-native/commit/a487be4))
|
|
119
|
+
* **eachAsync:** dedupe async iteration with a common helper ([c296f3a](https://github.com/mongodb/node-mongodb-native/commit/c296f3a))
|
|
120
|
+
* **execute-operation:** allow execution with server selection ([36bc1fd](https://github.com/mongodb/node-mongodb-native/commit/36bc1fd))
|
|
121
|
+
* **pool:** add support for resetting the connection pool ([2d1ff40](https://github.com/mongodb/node-mongodb-native/commit/2d1ff40))
|
|
122
|
+
* **sessions:** track dirty state of sessions, drop after use ([f61df16](https://github.com/mongodb/node-mongodb-native/commit/f61df16))
|
|
123
|
+
* add concept of `data-bearing` type to `ServerDescription` ([852e14f](https://github.com/mongodb/node-mongodb-native/commit/852e14f))
|
|
124
|
+
* **transaction:** allow applications to set maxTimeMS for commitTransaction ([b3948aa](https://github.com/mongodb/node-mongodb-native/commit/b3948aa))
|
|
125
|
+
* **Update:** add the ability to specify a pipeline to an update command ([#2017](https://github.com/mongodb/node-mongodb-native/issues/2017)) ([dc1387e](https://github.com/mongodb/node-mongodb-native/commit/dc1387e))
|
|
126
|
+
* add `known`, `data-bearing` filters to `TopologyDescription` ([d0ccb56](https://github.com/mongodb/node-mongodb-native/commit/d0ccb56))
|
|
127
|
+
* perform selection before cursor operation execution if needed ([808cf37](https://github.com/mongodb/node-mongodb-native/commit/808cf37))
|
|
128
|
+
* perform selection before operation execution if needed ([1a25876](https://github.com/mongodb/node-mongodb-native/commit/1a25876))
|
|
129
|
+
* support explain operations in `CommandOperationV2` ([86f5ba5](https://github.com/mongodb/node-mongodb-native/commit/86f5ba5))
|
|
130
|
+
* support operations passed to a `Cursor` or subclass ([b78bb89](https://github.com/mongodb/node-mongodb-native/commit/b78bb89))
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
<a name="3.2.7"></a>
|
|
135
|
+
## [3.2.7](https://github.com/mongodb/node-mongodb-native/compare/v3.2.6...v3.2.7) (2019-06-04)
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### Bug Fixes
|
|
139
|
+
|
|
140
|
+
* **core:** updating core to version 3.2.7 ([2f91466](https://github.com/mongodb/node-mongodb-native/commit/2f91466))
|
|
141
|
+
* **findOneAndReplace:** throw error if atomic operators provided for findOneAndReplace ([6a860a3](https://github.com/mongodb/node-mongodb-native/commit/6a860a3))
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
<a name="3.2.6"></a>
|
|
146
|
+
## [3.2.6](https://github.com/mongodb/node-mongodb-native/compare/v3.2.5...v3.2.6) (2019-05-24)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
<a name="3.2.5"></a>
|
|
151
|
+
## [3.2.5](https://github.com/mongodb/node-mongodb-native/compare/v3.2.4...v3.2.5) (2019-05-17)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
### Bug Fixes
|
|
155
|
+
|
|
156
|
+
* **core:** updating core to 3.2.5 ([a2766c1](https://github.com/mongodb/node-mongodb-native/commit/a2766c1))
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
5
160
|
<a name="3.2.4"></a>
|
|
6
161
|
## [3.2.4](https://github.com/mongodb/node-mongodb-native/compare/v3.2.2...v3.2.4) (2019-05-08)
|
|
7
162
|
|
package/index.js
CHANGED
|
@@ -10,6 +10,7 @@ const connect = require('./lib/mongo_client').connect;
|
|
|
10
10
|
// Expose error class
|
|
11
11
|
connect.MongoError = core.MongoError;
|
|
12
12
|
connect.MongoNetworkError = core.MongoNetworkError;
|
|
13
|
+
connect.MongoTimeoutError = core.MongoTimeoutError;
|
|
13
14
|
|
|
14
15
|
// Actual driver classes exported
|
|
15
16
|
connect.Admin = require('./lib/admin');
|
package/lib/admin.js
CHANGED
|
@@ -6,6 +6,7 @@ const AddUserOperation = require('./operations/add_user');
|
|
|
6
6
|
const ExecuteDbAdminCommandOperation = require('./operations/execute_db_admin_command');
|
|
7
7
|
const RemoveUserOperation = require('./operations/remove_user');
|
|
8
8
|
const ValidateCollectionOperation = require('./operations/validate_collection');
|
|
9
|
+
const ListDatabasesOperation = require('./operations/list_databases');
|
|
9
10
|
|
|
10
11
|
const executeOperation = require('./operations/execute_operation');
|
|
11
12
|
|
|
@@ -261,12 +262,11 @@ Admin.prototype.listDatabases = function(options, callback) {
|
|
|
261
262
|
if (typeof options === 'function') (callback = options), (options = {});
|
|
262
263
|
options = options || {};
|
|
263
264
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
return executeOperation(this.s.db.s.topology, listDatabasesOperation, callback);
|
|
265
|
+
return executeOperation(
|
|
266
|
+
this.s.db.s.topology,
|
|
267
|
+
new ListDatabasesOperation(this.s.db, options),
|
|
268
|
+
callback
|
|
269
|
+
);
|
|
270
270
|
};
|
|
271
271
|
|
|
272
272
|
/**
|