I am currently working with a CouchDB database that contains approximately one million rows. My goal is to query for specific rows in the database using the keys provided in an external JSON file. The approach I am currently using to achieve this involves iterating through the JSON keys and creating a separate view for each key. However, this method results in a separate view being created for every input from the JSON.
for i in test_json:
view = ViewDefinition('state', state_name.lower(),"""{function (doc){
if(doc._id == """+i+"""){
emit(doc._id,[doc.user_location,doc.user_project_links])
}}}""")
view.sync(db)
db.commit()
My question is whether it is possible to parse the JSON directly within the JavaScript query in CouchDB in order to create a single view in the end?