MongoDB is a document database with the scalability and flexibility that you want with the querying and indexing that you need.
Installation - Atlas Cloud
We can use this for free and its better then local server, as its more realistic environment. Go to http://www.mongodb.com and sign up for free cluster.
Create new cluster
Under Security -> Database Access create new user with Read and write to any database. You will need user and password later in your script where you will connect to db.
Under Security -> Network Access add your current IP address.
Back to Clusters, click on Connect, choose Connect your application
Now install MongoDb driver npm install --save mongodb.
util/database.js
app.js
Installation - Local Server
This was tested on xubuntu 18.04.
Remove previous MongoDB installations
Import the MongoDB public key
Create mongodb-org-4.0.list file for Ubuntu 18.04 (Bionic)