Hi, I have created a web map showing the local authorities (WFS) of UK. And I want to customize the popup with data from my MongoDB database. I have all the data stored in the database. But I failed to connect to MongoDB database in JavaScript with following command:
var MongoClient = require('mongodb').MongoClient;
var url = "mongodb://localhost:27017/";
MongoClient.connect(url, function(err, db) {
if (err) throw err;
var dbo = db.db("UKCP18_test");
});
So, I wonder how to connect to MongoDB database and query data to show in pop-up content.