How to view version information in mongodb

Time:2020-9-28

Here’s a summary of how to view mongodb’s version information

1: Connect to mongodb and use the command to view it.


> db.version();
4.0.0
> 

2: Mongo command view

Relative path using Mongo command


# ./mongo --version
MongoDB shell version v4.0.0
git version: 3b07af3d4f471ae89e8186d33bbb1d5259597d51
OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
allocator: tcmalloc
modules: none
build environment:
 distmod: rhel62
 distarch: x86_64
 target_arch: x86_64

Or use absolute paths


# /usr/local/mongodb/bin/mongo --version

3: View with mongod


# ./mongod --version
db version v4.0.0
git version: 3b07af3d4f471ae89e8186d33bbb1d5259597d51
OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
allocator: tcmalloc
modules: none
build environment:
  distmod: rhel62
  distarch: x86_64
  target_arch: x86_64

On the difference between Mongo and mongod

Mongod is the main process of processing mongodb system. It processes data requests, manages data stores, and performs background management operations. When we run the mongod command, it means that the mongodb process is starting and running in the background.

Mongo is a command-line tool used to connect a specific mongod instance. When we run the Mongo command without parameters, it will use the default port number to connect to localhost

summary

This article about how to view the version information of mongodb is introduced here. For more information about mongodb, please search the previous articles of developeppaer or continue to browse the related articles below. I hope you can support developeppaer more in the future!