-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MongoDB/*mongoose* deprecations #1516
Comments
Martii
added
migration
Use this to indicate that it may apply to an existing or announced migration.
CODE
Some other Code related issue and it should clearly describe what it is affecting in a comment.
labels
Aug 26, 2018
Martii
changed the title
MongoDB/*mongoose* deprecations
Aug 26, 2018
collection.count
is deprecated
These show up in local pro (different MongoDB version... already emailed sizzle about this incongruity): (node:26443) DeprecationWarning: collection.find option [fields] is deprecated and will be removed in a later version.
(node:26443) DeprecationWarning: collection.find option [fields] is deprecated and will be removed in a later version.
Connected to MongoDB v3.0.15
GitHub client authenticated
(node:26443) DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.
(node:26443) DeprecationWarning: collection.count is deprecated, and will be removed in a future version. Use collection.countDocuments or collection.estimatedDocumentCount instead
(node:26443) DeprecationWarning: Cursor.each is deprecated. Use Cursor.forEach instead. And some more... (node:26443) DeprecationWarning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.
(node:26443) DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.
(node:26443) DeprecationWarning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead. Ref: (node:32265) DeprecationWarning: collection.findAndModify is deprecated. Use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead. ... string ... (node:12406) DeprecationWarning: Mongoose: `findOneAndUpdate()` and `findOneAndDelete()` without the `useFindAndModify` option set to false are deprecated. See: https://mongoosejs.com/docs/deprecations.html#-findandmodify- |
Martii
added a commit
to Martii/OpenUserJS.org
that referenced
this issue
Oct 13, 2018
* Please read their CHANGELOGs * Delete op retested NOTE: * Some of *express* update applies to OpenUserJS#1516 but we still have some as well ex. delete op that I mention usually is one
Merged
Martii
added a commit
that referenced
this issue
Oct 13, 2018
* Please read their CHANGELOGs * Delete op retested NOTE: * Some of *express* update applies to #1516 but we still have some as well ex. delete op that I mention usually is one Auto-merge
Martii
added a commit
to Martii/OpenUserJS.org
that referenced
this issue
Dec 19, 2018
* Hopefully this will squash some warning messages. * We still have on legacy URL API call to migrate but waiting a bit Ref: * https://mongoosejs.com/docs/connections.html#use-mongo-client Applies to OpenUserJS#1516
Martii
added a commit
that referenced
this issue
Dec 19, 2018
* Hopefully this will squash some warning messages. * We still have on legacy URL API call to migrate but waiting a bit Ref: * https://mongoosejs.com/docs/connections.html#use-mongo-client Applies to #1516 Auto-merge
Martii
added a commit
to Martii/OpenUserJS.org
that referenced
this issue
Jan 16, 2019
* Utilize this method for mongodb native... `async`/`await` with `hasNext()`/`next()` tested and can also work but part of ES6+ NOTE: * Code looks more uniform with this method e.g. always wondered why there wasn't a final `aCallback` Ref: * https://stackoverflow.com/questions/25507866/how-can-i-use-a-cursor-foreach-in-mongodb-using-node-js#answer-25508173 Applies to OpenUserJS#1516
Martii
added a commit
that referenced
this issue
Jan 16, 2019
* Utilize this method for mongodb native... `async`/`await` with `hasNext()`/`next()` tested and can also work but part of ES6+ NOTE: * Code looks more uniform with this method e.g. always wondered why there wasn't a final `aCallback` Ref: * https://stackoverflow.com/questions/25507866/how-can-i-use-a-cursor-foreach-in-mongodb-using-node-js#answer-25508173 Applies to #1516 Auto-merge
Martii
added a commit
to Martii/OpenUserJS.org
that referenced
this issue
May 29, 2019
* Please read their CHANGELOGs * Delete op retested NOTES: * Squashing one *mongoose*/MongoDB deprecation ... doesn't appear to negatively affect anything in dev. Applies to OpenUserJS#1516 * Some bug fixes from at least one of our major deps * DB backend updated
Merged
Martii
added a commit
that referenced
this issue
May 29, 2019
* Please read their CHANGELOGs * Delete op retested NOTES: * Squashing one *mongoose*/MongoDB deprecation ... doesn't appear to negatively affect anything in dev. Applies to #1516 * Some bug fixes from at least one of our major deps * DB backend updated Auto-merge
Martii
added a commit
to Martii/OpenUserJS.org
that referenced
this issue
Jun 4, 2019
* Please read their CHANGELOGs * Delete op retested * Attempt to squash another MongoDB/*mongoose* deprecation ... applies to OpenUserJS#1516 * Dependency update failure with *moment-duration-format*... keeping pinned to older version. See jsmreese/moment-duration-format#131
Merged
Martii
added a commit
that referenced
this issue
Jun 4, 2019
* Please read their CHANGELOGs * Delete op retested * Attempt to squash another MongoDB/*mongoose* deprecation ... applies to #1516 * Dependency update failure with *moment-duration-format*... keeping pinned to older version. See jsmreese/moment-duration-format#131 Auto-merge
Martii
added a commit
to Martii/OpenUserJS.org
that referenced
this issue
Jun 5, 2019
* Big durr on my part Post OpenUserJS#1611 via OpenUserJS#1516
Martii
added a commit
that referenced
this issue
Jun 5, 2019
Martii
added a commit
to Martii/OpenUserJS.org
that referenced
this issue
Jun 28, 2019
* Keeping applicable TLS restricted for eventual 12.x+ compatibility * Search query *(modelQuery)* on, at the very least, `about` field causes maximum CPU usage in *node*@12.0.0 through *node*@12.5.0 but not v11.x or v10.x. This causes severe lag for everyone up to observed sustained 20+ seconds on queries. * Restarting and exposing with transforming to secondary indexing for Script model as per all [*mongoose*/MongoDB documentation](https://mongoosejs.com/docs/guide.html#indexes). Use `syncIndexes` to maintain DB indexes. * Squash new deprecation warning for OpenUserJS#1516 NOTES: * This is going to be a major issue when v10.x is EOL'd if *node* and related dep issues *(mongoose, mongodb)* aren't resolved * For some reason *mongoose* is emitting the `index` event twice when used globally... unknown reason atm. Picking local disable in favor. Applies to OpenUserJS#1548 and post OpenUserJS#1603 with observed issue since then. Refs: * https://mongoosejs.com/docs/guide.html#indexes Dev startup: ``` console $ node app.js Starting application... Disabling GitHub `hooks` in unsecure mode S3rver initialized error: Error creating bucket. Bucket "openuserjs.org" already exists info: PUT /openuserjs.org 409 11ms - Default dev S3 bucket already exists MongoDB connection is opened Connected to MongoDB v3.6.12 GitHub client authenticated Index event triggered/trapped for Script model Script indexes: [ { v: 2, key: { _id: 1 }, name: '_id_', ns: 'openuserjs_devel.scripts' }, { v: 2, key: { _authorId: 1, flagged: 1, isLib: 1 }, name: '_authorId_1_flagged_1_isLib_1', ns: 'openuserjs_devel.scripts', background: true }, { v: 2, key: { installName: 1 }, name: 'installName_1', ns: 'openuserjs_devel.scripts', background: true }, { v: 2, key: { isLib: 1, author: 1, name: 1 }, name: 'isLib_1_author_1_name_1', ns: 'openuserjs_devel.scripts', background: true } ] ``` Recent db stats: ``` console > db.scripts.aggregate( [ { $indexStats: { } } ] ); { "name" : "_id_", "key" : { "_id" : 1 }, "host" : "<db>:<port>", "accesses" : { "ops" : NumberLong(12842), "since" : ISODate("2019-06-27T04:10:25.453Z") } } { "name" : "isLib_1_author_1_name_1", "key" : { "isLib" : 1, "author" : 1, "name" : 1 }, "host" : "<db>:<port>", "accesses" : { "ops" : NumberLong(7348), "since" : ISODate("2019-06-27T12:26:13.574Z") } } { "name" : "installName_1", "key" : { "installName" : 1 }, "host" : "<db>:<port>", "accesses" : { "ops" : NumberLong(144052), "since" : ISODate("2019-06-27T04:10:25.453Z") } } { "name" : "_authorId_1_flagged_1_isLib_1", "key" : { "_authorId" : 1, "flagged" : 1, "isLib" : 1 }, "host" : "<db>:<port>", "accesses" : { "ops" : NumberLong(16691), "since" : ISODate("2019-06-27T04:10:25.453Z") } } ```
Martii
added a commit
that referenced
this issue
Jun 28, 2019
* Keeping applicable TLS restricted for eventual 12.x+ compatibility * Search query *(modelQuery)* on, at the very least, `about` field causes maximum CPU usage in *node*@12.0.0 through *node*@12.5.0 but not v11.x or v10.x. This causes severe lag for everyone up to observed sustained 20+ seconds on queries. * Restarting and exposing with transforming to secondary indexing for Script model as per all [*mongoose*/MongoDB documentation](https://mongoosejs.com/docs/guide.html#indexes). Use `syncIndexes` to maintain DB indexes. * Squash new deprecation warning for #1516 NOTES: * This is going to be a major issue when v10.x is EOL'd if *node* and related dep issues *(mongoose, mongodb)* aren't resolved * For some reason *mongoose* is emitting the `index` event twice when used globally... unknown reason atm. Picking local disable in favor. Applies to #1548 and post #1603 with observed issue since then. Refs: * https://mongoosejs.com/docs/guide.html#indexes Dev startup: ``` console $ node app.js Starting application... Disabling GitHub `hooks` in unsecure mode S3rver initialized error: Error creating bucket. Bucket "openuserjs.org" already exists info: PUT /openuserjs.org 409 11ms - Default dev S3 bucket already exists MongoDB connection is opened Connected to MongoDB v3.6.12 GitHub client authenticated Index event triggered/trapped for Script model Script indexes: [ { v: 2, key: { _id: 1 }, name: '_id_', ns: 'openuserjs_devel.scripts' }, { v: 2, key: { _authorId: 1, flagged: 1, isLib: 1 }, name: '_authorId_1_flagged_1_isLib_1', ns: 'openuserjs_devel.scripts', background: true }, { v: 2, key: { installName: 1 }, name: 'installName_1', ns: 'openuserjs_devel.scripts', background: true }, { v: 2, key: { isLib: 1, author: 1, name: 1 }, name: 'isLib_1_author_1_name_1', ns: 'openuserjs_devel.scripts', background: true } ] ``` Recent db stats: ``` console > db.scripts.aggregate( [ { $indexStats: { } } ] ); { "name" : "_id_", "key" : { "_id" : 1 }, "host" : "<db>:<port>", "accesses" : { "ops" : NumberLong(12842), "since" : ISODate("2019-06-27T04:10:25.453Z") } } { "name" : "isLib_1_author_1_name_1", "key" : { "isLib" : 1, "author" : 1, "name" : 1 }, "host" : "<db>:<port>", "accesses" : { "ops" : NumberLong(7348), "since" : ISODate("2019-06-27T12:26:13.574Z") } } { "name" : "installName_1", "key" : { "installName" : 1 }, "host" : "<db>:<port>", "accesses" : { "ops" : NumberLong(144052), "since" : ISODate("2019-06-27T04:10:25.453Z") } } { "name" : "_authorId_1_flagged_1_isLib_1", "key" : { "_authorId" : 1, "flagged" : 1, "isLib" : 1 }, "host" : "<db>:<port>", "accesses" : { "ops" : NumberLong(16691), "since" : ISODate("2019-06-27T04:10:25.453Z") } } ``` Auto-merge
During a dep update test cycle... (node:9303) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'createCollection' of undefined
at NativeConnection.createCollection (~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/node_modules/mongoose/lib/connection.js:356:11)
at ~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/node_modules/mongoose/lib/connection.js:451:12
at Object.promiseOrCallback (~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/node_modules/mongoose/lib/utils.js:261:12)
at NativeConnection.createCollection (~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/node_modules/mongoose/lib/connection.js:445:18)
at ~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/node_modules/mongoose/lib/model.js:1299:13
at Object.promiseOrCallback (~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/node_modules/mongoose/lib/utils.js:261:12)
at Function.createCollection (~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/node_modules/mongoose/lib/model.js:1296:16)
at ~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/node_modules/mongoose/lib/model.js:1340:10
at ~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/node_modules/mongoose/lib/utils.js:283:5
at new Promise (<anonymous>)
at Object.promiseOrCallback (~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/node_modules/mongoose/lib/utils.js:282:10)
at Function.syncIndexes (~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/node_modules/mongoose/lib/model.js:1337:16)
at Object.<anonymous> (~/repo/git/OpenUserJS.org/martii/OpenUserJS.org/models/script.js:86:8)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
(node:9303) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:9303) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. ... as far as I know we don't use promises but deps may internally. Squashed during testing: (node:8993) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor. (node:9088) DeprecationWarning: The option `reconnectTries` is incompatible with the unified topology, please read more by visiting http://bit.ly/2D8WfT6
(node:9088) DeprecationWarning: The option `reconnectInterval` is incompatible with the unified topology, please read more by visiting http://bit.ly/2D8WfT6 |
Martii
added a commit
to Martii/OpenUserJS.org
that referenced
this issue
Jan 24, 2020
* Please read their CHANGELOGs * Delete op retested * *diff* not bumped on GH repo but on npmjs.com * Downgrade *mongoose* to remove secondary index failure reported at OpenUserJS#1516 (comment)
Martii
added a commit
that referenced
this issue
Jan 24, 2020
* Please read their CHANGELOGs * Delete op retested * *diff* not bumped on GH repo but on npmjs.com * Downgrade *mongoose* to remove secondary index failure reported at #1516 (comment) Auto-merge
Martii
added a commit
to Martii/OpenUserJS.org
that referenced
this issue
Feb 5, 2020
* Please read their CHANGELOGs * Delete op retested * OpenUserJS#1516 (comment) addressed at Automattic/mongoose#8534
Merged
Martii
added a commit
that referenced
this issue
Feb 5, 2020
* Please read their CHANGELOGs * Delete op retested * #1516 (comment) addressed at Automattic/mongoose#8534 Auto-merge
Martii
added a commit
to Martii/OpenUserJS.org
that referenced
this issue
Sep 6, 2020
* Possible recommendation as `expires` alias to `expireAfterSeconds` may need this to properly set values of an index that is created app side to sync with back-end. * Increase event `emitter.setMaxListeners` to accommodate additional MongoDB usage with error thrown: ``` console Index event triggered/trapped for User model Index event triggered/trapped for Discussion model Index event triggered/trapped for Strategy model Index event triggered/trapped for Remove model Index event triggered/trapped for Comment model Index event triggered/trapped for Group model Index event triggered/trapped for Flag model Index event triggered/trapped for Vote model (node:10567) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 open listeners added to [NativeConnection]. Use emitter.setMaxListeners() to increase limit ``` Applies to OpenUserJS#1744 OpenUserJS#1730 and followup for OpenUserJS#1516 ... followup needed on mLab for index that's already there *(which I didn't put there)*
Martii
added a commit
that referenced
this issue
Sep 6, 2020
* Possible recommendation as `expires` alias to `expireAfterSeconds` may need this to properly set values of an index that is created app side to sync with back-end. * Increase event `emitter.setMaxListeners` to accommodate additional MongoDB usage with error thrown: ``` console Index event triggered/trapped for User model Index event triggered/trapped for Discussion model Index event triggered/trapped for Strategy model Index event triggered/trapped for Remove model Index event triggered/trapped for Comment model Index event triggered/trapped for Group model Index event triggered/trapped for Flag model Index event triggered/trapped for Vote model (node:10567) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 open listeners added to [NativeConnection]. Use emitter.setMaxListeners() to increase limit ``` Applies to #1744 #1730 and followup for #1516 ... followup needed on mLab for index that's already there *(which I didn't put there)* Auto-merge
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(node:26124) DeprecationWarning: collection.count is deprecated, and will be removed in a future version. Use collection.countDocuments or collection.estimatedDocumentCount instead
We use
.count
in at least [one place] where this can be changed although upstream says it's still using the MongoDB v3.x driver... so that's confusing.Refs:
With --trace-deprecation:
... doing this kills session management... so delay.... FIXED (this one code fence only)
(node:10349) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
The text was updated successfully, but these errors were encountered: