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:
That's outside the scope of the ArcGIS JSAPI. You're probably better asking on stackoverflow or a Mongodb specific forum about how to get it to work. Once you can connect and fetch the data, you can integrate it into the ArcGIS JSAPI Popup using a pattern like this sample.