microsoft / vscode-cosmosdb

Azure Databases extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-cosmosdb
MIT License
155 stars 67 forks source link

Display '3.2.0' after executing 'db.version();' with 4.2.0 mongodb installed #1207

Open v-xianya opened 5 years ago

v-xianya commented 5 years ago

OS: Windows Build Version: 20190928.1

Repro Steps:

  1. Download and install mongodb with 4.2 mongo shell.
  2. In vsCode, go to user settings(F1-> User Settings).
  3. Add "mongo.shell.path": "C:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" to settings.json.
  4. Run 'db.version();' in scrapbook.
  5. Check the result.

Expect: Display '4.2.0'. image

Actual: Display '3.2.0'. image

wwlorey commented 4 years ago

@v-xianya Try checking your mongod --version and mongo --version to see if those numbers match up. You may have updated your shell, not the server

v-xinda commented 4 years ago

@wwlorey This issue also reproduces on the latest build 20200423.10. MongoDB version is consistent with the db version. image

wwlorey commented 4 years ago

Even if your local mongo version is 4.2.0, mongo will default to the version associated with the given connection string when starting the shell. It makes sense that your result was 3.2.0 since that's the version of your mongo account in Azure (that's the default version we create in the extension)

v-mengwe commented 3 years ago

@wwlorey As we talked in the teams, reopen this issue. Mongo DB Version: 4.4.4 Mongo DB Account Version: 3.6.0

In the OGF, the expect result of executing "db.version()" is the version of mongo.exe. image Now, the result of executing "db.version()" is the version of Mongo DB Account. image I am confused which result should be?