Where is the shell client for MongoDB, I found a number of packages related to MongoDB in Ubuntu 18.04 LTS but can't seem to find information where exactly is this client and what I should install.
I know that if I install the MongoDB package the shell will be included but I don't need the server and other stuff because I have Atlas (cloud db server).
Here are the links I found on the internet:
- https://packages.ubuntu.com/bionic/database/mongodb-clients
- https://packages.ubuntu.com/bionic/mongo-tools
Does it make sense going trough all the trouble above and should I simply install the MongoDB package?
If you just want the
mongo
shell, you could install themongodb-clients
package mentioned in your question. However, note that this includes an older shell version (3.6.3).The official MongoDB packages are updated with each minor release and you should ideally install a shell version matching your MongoDB server's major version (3.6, 4.0). Significant mismatches in shell versus server versions can result in some subtle errors as well as missing or outdated helpers. For example, the MongoDB 3.6.x shell doesn't have helpers for transactions (which were added in 4.0).
The MongoDB documentation includes information on Installing the official packages on Ubuntu. There is a
mongodb-org-shell
package which only includes the MongoDB shell, and you may also want to installmongodb-org-tools
for other command-line tools (mongodump
,mongorestore
, ...).It would be best to follow the instructions in the MongoDB documentation as some details may change in future (such as the signing key), but the general steps to follow for MongoDB 4.0 on Ubuntu 18.04 (Bionic) are:
Import the public key used to sign packages from MongoDB, Inc
Create a package list file for MongoDB
Update your local package database
Install the desired MongoDB package(s)
You might want to install
mongosh
(MongoDB Shell) instead. The legacymongo
shell has been deprecated since MongoDB v5.0 and replaced bymongosh
. From the official website:Further reference: Compatibility Changes with Legacy mongo Shell