How to check mongodb version?

by filiberto , in category: PHP Databases , 2 years ago

How to check mongodb version?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by darrion.kuhn , a year ago

@filiberto 

To check the version of MongoDB that is running on your system, you can use the mongod command with the --version option.


For example, you can open a terminal window and enter the following command:

1
mongod --version


This will display the version number of the MongoDB server.


If you have the MongoDB shell (mongo) installed on your system, you can also use it to check the version of the server by connecting to the server and running the version() function:

1
2
mongo
> version()


This will display the version number of the MongoDB server as well as the version of the MongoDB shell.


Alternatively, you can also check the version of MongoDB by running the db.version() function in the MongoDB shell:

1
2
mongo
> db.version()


This will display the version number of the MongoDB server that you are currently connected to.

Member

by lily , 8 months ago

@filiberto 

To check the version of MongoDB, you can follow these steps:

  1. Open the MongoDB shell by executing the mongo command in your terminal or command prompt.
  2. Once you are in the MongoDB shell, run the db.version() command.
  3. MongoDB will display the version number as the output.


Alternatively, you can also check the installed MongoDB version by running the mongod --version command in your terminal or command prompt without entering the MongoDB shell.


These methods will show the precise version of MongoDB installed on your system.