Today on “Identifying my Mongo” we are going to look at how someone would know what version of Mongo DB they are running. For those who do not know what Mongo DB is, please visit their website here (https://www.mongodb.com/what-is-mongodb).
To figure out what version of MongoDB is installed is easy. There are several ways you can do this. Today we will look at a couple of ways to figure out what version you are using. Let’s get started.
Number 1: Windows Control Panel
If your MongoDB is installed on a Windows Operating System, chances are that its listed in the Program and Features under Windows Control Panel. If you do not know what Control Panel is, I have stated its definition below.
Definition: The Control Panel is a component of Microsoft Windows that provides the ability to view and change system settings. It consists of a set of applets that include adding or removing hardware and software, controlling user accounts, changing accessibility options, and accessing networking settings. Additional applets are provided by third parties, such as audio and video drivers, VPN tools, input devices, and networking tools.
The Program and Features applet in Control Panel should be able to tell you what version of MongoDB is installed. You can get to the control panel by searching for “control panel” under the start menu or by hitting the keyboard shortcut keys Win+R and typing control.
You’ll want to select Programs and Features to load a list of programs you have installed.
The list should like this:
Notice how it says MongoDB Enterprise for Sage X3 and has a version 3.2.6
This would be the type of MongoDB and version. There are two types: Community Edition and Enterprise Edition. Community is free and does not come with any support agreement and does not come with any tools. Enterprise Editions cost but come with support and tools.
What if you didn’t install the MongoDB that came with Sage Enterprise Management or you already had a MongoDB installation running?
The Control Panel may not tell you what Type of MongoDB installation you have. Sage Enterprise Management coded the install to have the type in the title. Other installations may not do that.
So how do you tell for sure?
There is another way to see exactly what version and type you have installed no matter what Control Panel does or does not say.
It’s through Command Prompt!
Number 2: Windows Command Prompt
Yep, going to have to go through good old command prompt (CMD).
Before we get to that we have to locate the mongod.exe executable first. It is usually in the BIN directory of the MongoDB install.
Here is an example of where to look:
Make a note of the file path in the address bar for we will need it when we get to CMD. We are going to use this address to launch the mongod.exe from the command.exe function within Windows OS. Now, we want to go to Windows Start bar and click on the Start icon. In the search field we will be searching for cmd.exe. Then, we will right click and run as administrator. We run as administrator to make sure we have enough rights.
You should have a black box window that is the command prompt (CMD).
At this point, we are going to change the directory to one where mongod.exe is located.
In our example, it is: C:\Sage\MongoDB_Entreprise_for_Sage_Syracuse\mongodb-win32-x86_64-2008plus-ssl-3.2.6\bin
In the command prompt (CMD), we will type the following:
The CMD should now look like so.
Now that we are here, we are going to type mongod.exe –version and execute (which means hit enter).
Note: it is a space and two dashes after mongod.exe (- - version)
You should get the following results:
As you see it is saying the same version as what Control Panel says, v3.2.6, but the key here is that the modules says “none”. None means it is community edition. If it was a paid version like Enterprise, the module listing would say “Enterprise”.
And therefore, we do not trust the details of Control Panel. We may have at one point installed Enterprise Edition, but our license could have expired, an upgrade could have not properly updated the registry, etc.… There could be several reasons why the version is not properly displayed within the Control Panel.
Now you know where to find the exact version, type, and build.