Skip to content
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

Upgraded "mongodb" npm package to 3.4.1 #20

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

enosrecanati
Copy link

Upgraded "mongodb" npm package to 3.4.1

Now it's possible to run the application using MongoDB server from 2.6 to 4.2; verified with:

  • local MongoDB Community 4.4.23 Server
  • local MongoDB Community 4.2.2 Server (the current stable version)
  • using deadrobots/pixi:datastore Docker image, as per docker-compose specifications

It's also possible to user Node.js runtime from 4.x.x to 12.x.x; verified with:

  • local 8.17.0 installation
  • local 12.14.1 (the current LTS)
  • using node:8.1.2-alpine Docker image, as per docker-compose specifications

MongoDB driver compatibility matrix: https://docs.mongodb.com/ecosystem/drivers/driver-compatibility-reference/#node-js-driver-compatibility

In addition, now "counters" collection documents are now auto initialized if doesn't exist. Useful if launched on localhost with an empty database, instead of using the docker image.

A lot of deprecation warnings now on MongoDB client methods calls during the debug, a little bit of refactoring needed to prevent them.
…ationWarning while connection to the database

Complete DeprecationWarning previously displayed during debug:

"(node:74519) 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."
Completed DeprecationWarning message previously displayed while debugging:

"(node:74838) DeprecationWarning: collection.findAndModify is deprecated. Use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead."
Completed DeprecationWarning message previously displayed while debugging:

"(node:78105) DeprecationWarning: collection.insert is deprecated. Use insertOne, insertMany or bulkWrite instead."
Completed DeprecationWarning message previously displayed while debugging:

"(node:78305) DeprecationWarning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead."
…e MongoDB driver after the upgrade

the options [servers] is not supported
the options [caseTranslate] is not supported
the options [dbName] is not supported

They are related to ConnectionPooling and the suggestions are to connect one and let the Driver manage the pool, https://mongodb.github.io/node-mongodb-native/1.4/driver-articles/mongoclient.html#mongoclient-connection-pooling
Allows to start the application to be launched from another folder (eg. using VSCode Debug/Run tab) saving the uploaded pictures in the right folder
as per README the default launch conguration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant