MongoDB is a free and open-source database management system that is designed for scalability, flexibility, and ease of development. It is classified as a NoSQL database which is different than traditional table-based SQL databases like MySQL and PostgreSQL.

MongoDB 7.0 is now generally available and ready for use which offers a comprehensive suite of features designed to streamline operations, improve performance, and enhance security. With this release, MongoDB reaffirms itself as a top choice for organizations looking to boost the productivity of their development teams as they build modern, distributed applications. Version 7.0 has all the features released in prior versions with additional features aimed at making it easier for developers to build software.

What’s new with MongoDB 7.0

4 Big Reasons to Upgrade to MongoDB 7.0

  • Enhanced performance – MongoDB 7.0 brings significant improvements to working with time series data, especially demanding, high-volume datasets of all shapes. These improvements result in improved storage optimization and compression, as well as improved query performance. Developers will experience even better handling of high cardinality data, improved scalability, and overall performance; enabling you to manage time-series data more efficiently and cost-effectively.
  • Smoother migrations – Updates to cluster-to-cluster sync (mongosync) will enable more efficient data migration in a variety of scenarios. Cluster-to-cluster sync now provides greater flexibility in syncing between clusters with unlike topologies, such as from replica sets to sharded clusters. Filtered sync allows for syncing specific data sets instead of the entire cluster.
  • Streamlined developer experience – With new enhancements to the aggregation pipeline — including compound wildcard indexes, approximate percentiles, and bitwise operators — developers can enjoy greater flexibility and performance in indexing and querying data. With MongoDB 7.0, developers can also implement user role variables within aggregation pipelines enabling a single view to display different data based on the logged-in users’ permissions.
  • Stronger security – MongoDB 7.0 strengthens security capabilities with Queryable Encryption to help customers encrypt sensitive data and run equality queries on fully randomized encrypted data. The security enhancements ensure that developers can build and deploy applications with confidence, knowing that their data is protected and compliant with the latest security standards and protocols.

MongoDB Lifecycle

VersionRelease DateEnd of life
7.0August 2023TBD
6.0July 2022July 2025
5.0July 2021October 2024
4.4July 2020February 2024
4.2August 2019April 2023
MongoDB EOL

IMPORTANT : v4.2 reached end of life on April 2023 and is no longer officially supported by MongoDB.

MongoDB-7-installation
MongoDB-7-installation

Steps to install MongoDB 7.0 on Linux servers

Installation of database MongoDB 7.0 on Linux is easy. This guide will help you how to install MongoDB 7.0 Community Edition on Linux servers like Ubuntu, Debian, CentOS, RHEL, Oracle Linux, Rocky Linux and AlmaLinux.

Prerequisites:

  • sudo privileges.
  • Stable internet connection.
  • Disable SELinux and Firewall.

First check server OS version then start installation as per OS version:

# egrep '^(VERSION|NAME)=' /etc/os-release

Important

When you are using any VPS server then you need to verify server compatibility with MongoDB. Please run below command to check server compatibility.

# grep -qm1 '^flags.*avx' /proc/cpuinfo && echo OK || echo NOT OK

If print OK on the console then you can continue with the installation, If print NOT OK then your CPU doesn’t support MongoDB 7.0 and MongoDB only supports Oracle Linux running the Red Hat Compatible Kernel (RHCK). MongoDB does not support the Unbreakable Enterprise Kernel (UEK).

MongoDB Installation on Red Hat family:

Steps to install MongoDB 7.0 on Red Hat Enterprise Linux, CentOS, Oracle Linux, Rocky Linux, Amazon Linux and Alma Linux.

Set up MongoDB yum repository for Red Hat Enterprise LinuxCentOS, Oracle Linux Rocky Linux and Alma Linux:

# tee /etc/yum.repos.d/mongodb-org-7.0.repo<<EOM
[mongodb-org-7.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/\$releasever/mongodb-org/7.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-7.0.asc
EOM

Set up MongoDB yum repository for Amazon Linux 2:

# tee /etc/yum.repos.d/mongodb-org-7.0.repo<<EOM
[mongodb-org-7.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2/mongodb-org/7.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-7.0.asc
EOM

Set up MongoDB yum repository for Amazon Linux 2023:

# tee /etc/yum.repos.d/mongodb-org-7.0.repo<<EOM
[mongodb-org-7.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2023/mongodb-org/7.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-7.0.asc
EOM

To install MongoDB 7.0, run the following command:

# yum install -y mongodb-org

MongoDB Installation on Debian family:

Steps to install MongoDB 7.0 on Debian and Ubuntu

Install the prerequisites:

# apt install -y curl wget gnupg lsb-release

import the MongoDB public GPG Key

# wget -qO - https://pgp.mongodb.com/server-7.0.asc | sudo apt-key add -

The operation should respond with an OK

Now set up the apt repository as per your Ubuntu version:

For Ubuntu 22.04 (Jammy)
# echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

For Ubuntu 20.04 (Focal):
# echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

For Ubuntu 18.04 (Bionic):
# echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

For Ubuntu 16.04 (Xenial):
# echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

Or set up the apt repository as per your Debian version:

For Debian 11 "bullseye"
# echo "deb http://repo.mongodb.org/apt/debian bullseye/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

For Debian 10 "Buster"
# echo "deb https://repo.mongodb.org/apt/debian buster/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

For Debian 9 "Stretch"
# echo "deb https://repo.mongodb.org/apt/debian stretch/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

For Debian 8 "Jessie"
# echo "deb https://repo.mongodb.org/apt/debian jessie/mongodb-org/7.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

Then update the local package database:

#  apt update

Note: If you are facing any GPG error like “signatures couldn’t be verified because the public key is not availablethen run

# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 160D26BB1785BA38 && apt update

Then Install the MongoDB 7.0 latest version:

# apt install -y mongodb-org

 Managing the MongoDB service

let’s review some basic management commands.

Verify installed version of MongoDB:

# mongod -version

Start the MongoDB service:

# systemctl start mongod.service

Check status of the MongoDB service:

# systemctl status mongod.service

If you receive an error or service failed to start then run the following commands:

# systemctl daemon-reload
# chown mongod:mongod /tmp/mongodb-27017.sock
# systemctl start mongod.service

Restart the MongoDB service:

# systemctl restart mongod.service

If you want to stop MongoDB service:

# systemctl stop mongod.service

By default, MongoDB service is disabled to start automatically when the server boots. If you want to enable it at startup, run:

# systemctl enable mongod.service

Re-disable the service to start up at boot:

# systemctl disable mongod.service

Uninstall MongoDB 7.0

To completely remove MongoDB from a system, you must remove the MongoDB applications, the configuration files, and any directories containing data and logs.

WARNING: This process will completely remove MongoDB, its configuration, and all databases. This process is not reversible, so ensure that all of your configuration and data is backed up before proceeding.

Stop the mongod service

# systemctl stop mongod.service

Remove any MongoDB packages that previously installed.

For RHEL / CentOS/ Oracle Linux / Rocky Linux / Amazon Linux

# yum erase $(rpm -qa | grep mongodb-org)

For Ubuntu / Debian

# apt autoremove --purge mongodb-org

Remove MongoDB databases and log files.

# rm -rf /var/log/mongodb
# rm -rf /var/lib/mongo

Conclusion

Congratulations! We’ve installed latest MongoDB 7.0 on Linux system. We hope this 2 minutes stuff helped you and thank you for visiting our website.
Cheers!!!