Am new to couchdb2.0,working on map function.I have written a function
function(doc) {
if(doc.entityType!=null){
if(doc.cityName!=null && doc.locationName!=null){
var key =[doc.cityName,doc.locationName,doc.entityType]
emit(key, doc);
}
}
}
which is throwing
{"error":"compilation_error","reason":"Expression does not eval to a function. >>(function(doc) {\n if(doc.cityName!=null && doc.entityType!=null){key=>>[doc.cityName,doc.entityType] emit(key, doc);\n}})"}
Please help me out.