Check MongoDB Version in Windows / Linux
To check mongodb version use the mongod command with --version option.
To check MongoDB Server version, Open the command line via your terminal program and execute the following command:
mongod --version
To Check MongoDB Shell version, Type:
mongo -version
(Mongo Shell is the command line client)
On windows you will have to use full path to the mongod.exe and mongo.exe to check mongodb version, if you have not set MongoDB Path.
"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe" --version
db version v3.4.9
git version: 876ebee8c7dd0e2d992f36a848ff4dc50ee6603e
OpenSSL version: OpenSSL 1.0.1u-fips 22 Sep 2016
allocator: tcmalloc
modules: none
build environment:
distmod: 2008plus-ssl
distarch: x86_64
target_arch: x86_64
But if MongoDb Path is being set, you can simply use the mongod and mongo command.