How to check mongodb version?

by filiberto , in category: PHP Databases , 8 months ago

How to check mongodb version?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by darrion.kuhn , 3 months 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.