I have a couchDB database that contains various documents. These documents need to be accessed through my web application, where users can input specific words to retrieve the corresponding document from the database. This is my _design document
{
"_id": "_design/recuperar",
"_rev": "3-6787751eb0ed728b482ef7b06658e8da",
"language": "javascript",
"views": {
"grafos": {
"map": "function(doc) {\n var value;\n if (doc.nome== 'Egypt') { \n value = [doc.nodos, doc.links];\n emit(doc.nome, value); \n }\n}"
}
}
}
Currently, this setup works as intended. However, I am looking for a way to make 'Egypt' a variable based on the user's search query. Is it possible to achieve this dynamically, or will I need separate views for each search/query?
Thank you!