After adding a mongodb you may experience an error about the GPG PUB KEY like teh following.
W: GPG error: http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/testing Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 68818C72E52529D4
E: The repository ‘http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/testing Release’ is not signed.
You can fix this issue by adding the PUB KEY for MongoDB’s repository.
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 68818C72E52529D4
Try update again
I don’t like to use big repeating command and I was searching for a solution where I will be setting a variable embedded with something so every time I start my meteor app; the MONGO_URL will set to environment automatically. So this what I did:
In the package.json file I replaced the start parameter as below:
"start": "MONGO_URL=mongodb://username:password@host_url:portnumber/dbname meteor run"
Great for development. Say you want to share the database with someone else in a remote location.
package.json file with
npm init, if you don’t have one already.
Enter and modify the following line in that file (replacing all the
"meteor": "MONGO_URL=mongodb://<USER>:<PASSWORD>@<SERVER>:<PORT>/<DB> meteor"
For meteor to start using your remote MongoDB start meteor with
npm run meteor
If you are looking for a way to remove an item from mongodb which is contained in an array the following stackoverflow post has the answer.