Can't start Mongodb shell on MacOS Mojave 10.14.2 - mongodb

Installed MongoDB Community Edition version 3.6 (because my work project requires that version). I am for some reason unable to run the MongoDB shell, so when trying to run mongo or mongod from the terminal I just get -bash: mongod: command not found. When checking which Brew services are running with brew services list, mongodb-community#3.6 is listed. The application I'm working on also utilises MongoDB succesfully. My main issue is that I can't access the MongoDB shell.

The solution to my problem was that I was supposed to install the shell separately with brew. This was not the case with previous MongoDB versions and it is not mentioned in the official MongoDB documentation.

Related

MongoDB Installation error. what is solution for this error?

what is solution for this error.
I want to install MongoDB in Mac with home-brew but this error in terminal
❯ brew tap mongodb/brew
❯ brew install mongodb-community
Error: No such file or directory - /opt/homebrew/var/homebrew/linked/mongodb-community
I want to install MongoDB...
Download the MongoDB Community Server version suitable for your Mac from the official website: https://www.mongodb.com/download-center/community.
Install MongoDB by double-clicking the downloaded .pkg file.
Note: To run MongoDB as a service on macOS, refer to the official MongoDB documentation on setting up launchd: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/#configure-launchd-to-start-mongodb-automatically.

Upgrading older mongo database after unintentional mongo version upgrade

Is there any way to upgrade a mongo database after the mongodb package was unintentionally upgraded (3.4.9 -> 3.6.1)?
According to the mongo docs, as a prerequisite of the upgrade, featureCompatibilityVersion has to be set from the mongo cli tool, which, however, needs a running mongod database daemon, which, however, won't run if mongodb package was already upgraded and the database was not set the featureCompatibilityVersion flag.
I'm on ArchLinux, I had mongodb in IgnorePkg but it's dependencies boost-libs and wiredtiger got upgraded anyways. Having pacman cache already wiped out, I compiled older versions of the packages myself, but running mongodb keeps failing with this error:
unsupported WiredTiger file version: this build only supports major/minor versions up to 1/0, and the file is version 2/0: WT_ERROR: non-specific WiredTiger error
I don't have a clue what the hell this means (the problematic version of wiredtiger is 2.9.3-1, version after the upgrade is 2.9.3.20171205-2).
Seems like I can neither downgrade nor upgrade...
Other cli tools (e.g. mongodump) also won't run without a running database, is there any other possibility (some wiredtiger related tool)? Deleting the database and starting afresh is not an option.
I solved the problem by installing the older version of mongodb on a system for which it wasn't a problem to get it pre-packaged (well, Windows 10, even though oficially it's stated the package is for Windows Server 2008), copying the database files (contents of /var/lib/mongodb) there, running it with --dbpath param (mongod --dbpath /path/to/dbfiles), setting the compatibility flag according to the docs and finally copying the db files back to the server.
Would like to know about a better option, but it's good to know the db files are easily transferable to another system, even another architecture (the db was relatively simple and small though).
Running mongod --repair worked for me.
here similar issue, unintentionally upgrade from 4.2.1 to 4.4.3, then mongodb can NOT started..
Final worked solution:
uninstall (latest, but not worked version: 4.4.3)
brew uninstall mongodb-community
reinstall, old but worked 4.2.1
brew install mongodb-community#4.2
run
for now: brew services run mongodb-community#4.2
for now and set bootable: brew services start mongodb-community#4.2
check status
brew services

Mongodb server version not upgraded in mac

I updated MongoDB to 3.4.10 using HomeBrew
brew update
brew upgrade mongodb
When I check db.version() it says 3.0.6.
But When I run 'mongo' command it says Shell version - 3.4.10 and server version - 3.0.6. Server and Shell version do not match. I want to use aggregate commands that is not supported in version 3.0.6.
So any one knows the answer reply here. Thank you :)

After installing mongoDB 3.4, mongod still runs old version of mongodb

I just installed mongoDB v3.4 on my mac using homebrew however when I run mongod from terminal it still run the old v2.6 mongoDB. What do I need to do to fix this?
I had to run
brew link --overwrite mongodb

MongoDB: Upgrade 2.4.10 to 2.6

I have a mongodb standalone instance in my ubuntu. According to official docs I replace mongod binary then I restarted mongodb using sudo service mongodb restart command, and restarted mongod binary also. Then when I check version using mongo --version. It's still 2.4.10. But when I check mongod version it's 2.6.1. Is it okay? I installed mongodb in my local machine using this guide. If it correct then I will upgrade my production server.
It sounds like you have upgraded your mongod server to 2.6.1 but still have an older version of the mongo shell in your path.
Technically that isn't a major issue for most usage as the older 2.4 shell can still connect and run common commands.
However, there are 2.6-specific shell helpers & features you'll be missing out on such as Bulk() operations and user management commands with user-defined roles.
If you have an open mongo shell, you can check the versions of both the mongo client and the mongod server you are connected to.
Ideally the major versions should match, eg:
> version() // Version of the `mongo` shell
2.6.1
> db.version() // Version of the `mongod` server this shell has connected to
2.6.1
The upgrade guide you have followed is assuming you are not using the packaged versions of MongoDB -- the guidance here could definitely be improved.
A better (and typical) approach for Ubuntu is to install MongoDB using the standard packages: Install MongoDB on Ubuntu. This would allow you to get software updates via the normal apt-get update process.
Yes. It's okay. The 2.6.1 version is a small update with bugfixes after version 2.6. But it's still the same major version.