mkdir test-mongodb && cd test-mongo-db npm init
npm install mongodb
Just in case, the script is running under node.js version 20.15 and mongodb module version 6.8 (current on moment of writing). To check the versions:
(more…)curl -fsSL https://pgp.mongodb.com/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor
echo "deb [ arch=arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list sudo apt-get update
sudo apt-get install -y mongodb-org
sudo chown mongodb:mongodb /var/log/mongodb/ sudo chown mongodb:mongodb /var/lib/mongodb/
sudo systemctl enable mongod sudo systemctl start mongod sudo systemctl status mongod
Install PECL
sudo apt install php-pear phpX.X-dev # X.X is PHP verion used
sudo pecl install mongodb # the system could require to update PECL # sudo pecl channel-update pecl.php.net(more…)