show mongodb version 1

show mongodb version

mongod --version

Here is what the above code is Doing:
1. We’re using the subprocess module to run the mongod command.
2. We’re using the check_output() function to run the command.
3. We’re passing the –version argument to the mongod command.
4. We’re storing the output of the command in the output variable.
5. We’re printing the output.

Similar Posts