mongodb-js / vscode

Connect to MongoDB and Atlas and directly from your VS Code environment, navigate your databases and collections, inspect your schema and use playgrounds to prototype queries and aggregations.
https://marketplace.visualstudio.com/items?itemName=mongodb.mongodb-vscode
Apache License 2.0
326 stars 58 forks source link

Question: MongoDB versions #384

Closed joaofconde closed 2 years ago

joaofconde commented 2 years ago

Issue to connect mongo 3.6

Question

Do you know how to fix this problem? "Unable to load connection: Error: Failed to connect: Server at X.X.X.X:27017 reports maximum wire version 5, but this version of the Node.js Driver requires at least 6 (MongoDB 3.6)"

Additional context

Anemy commented 2 years ago

Hi @joaofconde can you send us a screenshot of your mongodb version? Connecting with the MongoDB shell should output the server version on the first line. https://www.mongodb.com/try/download/shell We usually see that error when the server version is < 3.6, and we currently only support 3.6 and greater. Thanks for checking out the extension! Hopefully we can get this working for you quickly

alenakhineika commented 2 years ago

I can reproduce the error when connecting to MongoDB 3.4, @joaofconde could you please check maybe you are also running MongoDB 3.4 instead of MongoDB 3.6.

joaofconde commented 2 years ago

My mongo is version "v3.4.15", is possible change Node.js driver to older that support this mongodb version?

joaofconde commented 2 years ago

I can reproduce the error when connecting to MongoDB 3.4, @joaofconde could you please check maybe you are also running MongoDB 3.4 instead of MongoDB 3.6.

Yes i'm running version 3.4.

jnjaga24 commented 2 years ago

Not able to connect to Mongodb 3.4 version . Able to connect Mongodb 3.6 version . Any workaround to connect 3.4 ?

alenakhineika commented 2 years ago

The 3.4 version was EOLed before we started working on the extension (Jan 2020) so there were never plans to support it.

joaofconde commented 2 years ago

So with Compass tools, standalone or using vs code extension, isn't able connect to EOLed versions? So i'm forced do mongo upgrade? Or buy tools to manage EOLed version?

Doesn't exist workaround?

mmarcon commented 2 years ago

Hi @joaofconde, thank you for your question.

We are not intentionally preventing the VS Code extension, Compass, or the MongoDB Shell from working with EOL versions of MongoDB to force users and customers to upgrade. However, when we look at adding functionality that will make things easier/faster/better for developers, it might happen that we need to take advantage of features/APIs of MongoDB that were not available in old versions of the server or that we need to use a newer driver that isn't compatible with old/EOLed version of MongoDB. In these situations, we look at the trade-off, and often the outcome is that we want to move our developer experience forward, and to do so we, unfortunately, have to drop support for old versions of MongoDB.

In general, if you are running MongoDB versions older than 4.0, I would strongly recommend upgrading to a more modern version of the Server. Should that not be possible, you could try one of the first versions of the extension (you should be able to pick a version when you install it from the marketplace) or if Compass is also a viable option, you can download any version of Compass from Github: https://github.com/mongodb-js/compass/releases. I can't say for sure which version will work with 3.4 but I'd start with trying one released around the beginning of 2021. Make sure you disable auto-updates after installing it, otherwise it will get updated to the most recent one automatically.