Hi,
I’m getting confused, I’m trying to setup a custom db connection, I saved my db credentials in the settings k/v store but when I want to get the credentials using the code snippet configuration.myKeyName
I’m getting a function and not a string.
And if I console.log it I get undefined
So if I use configuration[“myKeyName”] it isn’t undefined anymore.
If I do typeof configuration["myKeyName"]
it returns a string
, so why when I init a mongoclient I get this error:
UnhandledPromiseRejectionWarning: TypeError: Parameter "url" must be a string, not function
const client = new MongoClient(configuration["mongodbConnectionString"], {
useNewUrlParser: true
});
Ok so if I pass directly the url it says it’s a function.
WTF