I tried to set dynamically change host and port in mongodb url but its not working. Can anybody give some suggestion? How to set host and port in mongodb url?
mongodb_url.js
host="localhost"
port="27017"
user ="root"
password = "mongodb"
let url = "mongodb://{user}:{password}@{localhost}:{port}";
url is not working how to set correctly using mongodb and node js