The following is courtesy of Reddit user salacious_sonogram
from this post.
Copy/Paste this:
[mongodb-org-7.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/9Server/mongodb-org/7.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/server-7.0.asc
into
sudo nvim /etc/yum.repos.d/mongodb-org-7.0.repo
Then run
dnf install mongodb-org
systemctl stop mongod
rpm -e mongodb-org mongodb-mongosh
dnf install -y mongodb-org mongodb-mongosh-shared-openssl3
systemctl start mongod