I have some code in my app in nodeJs which generates a filter list based on data in the back-end. There is static and dynamic filters. For the dynamic filters i store the name of the query string in my config as a string. So the question is how can i use that string not as a string but as the name of an const which holds that query string. Below is what my code looks like. data[i].queryname holds in this case the string tractList
let result = await couch.n1qlQuery_wId('contacts', data[i].queryname ,[])
for (let b = 0; b < result[0].length; b++) {
let newOption = new option
newOption.value = result[0][b].value_key
newOption.name = result[0][b].name
newOption.selected = false
newFilter.options.push(newOption)
}
here is what my const looks like
const tractList = 'select meta().id value_key, name from Contacts where _type = "tract_info" order by name'