how to upgrade mongodb version in ubuntu code example

Example 1: update mongodb version ubuntu

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 656408E390CFB1F5

Example 2: update mongodb version ubuntu

echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb.list

Example 3: update mongodb version to 4 ubuntu

mongodb-org is already the newest version (4.0.10).