Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is MongoDB shell version differen than db.version()?

Tags:

mongodb

I just updated from MongoDB 2.4.9 to 2.4.10 using brew upgrade mongodb.

Why is the reported shell version different than what is reported by db.version()?

>>> mongo
MongoDB shell version: 2.4.10
connecting to: test
Server has startup warnings: 
Sat Apr  5 13:13:03.414 [initandlisten] 
Sat Apr  5 13:13:03.414 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
>>> db.version()
2.4.9

like image 407
cathy.sasaki Avatar asked Apr 15 '26 04:04

cathy.sasaki


1 Answers

You have a different version of the MongoDB shell compared with the MongoDB server. The second line of your output is reporting the shell version, whereas the db.version function reports the server version.

Have you restarted your MongoDB server process after running the brew update? This would only have changed the binaries on disk and not have altered any running instances.

You should also check the path of the MongoD binary and the Mongo shell binary to see if they come from the same path.

like image 94
daveh Avatar answered Apr 18 '26 04:04

daveh