I am trying to search in couchDb using temporary view in futon.
The view code is like this:
function(doc)
{
if(doc.Time Zone.value == "America/Los_Angeles")
{
emit([doc.owner, doc.source], null);
}
}
But when I try to sun this view, it give the following error:
Error: compilation_error
Expression does not eval to a function. ((new String(“function(doc) { if(doc.Time Zone.value == \”America/Los_Angeles\”) { emit([doc.owner, doc.source], null); } }”)))
I think this is because of a space in doc.Time Zone. If a remove this space it compiles but didn’t give any values. Compiler dont want this empty space.
Please help me.
This is because the way you access your document’s Time Zone field is invalid.
The proper way to access that field would be
It is a basic JavaScript issue you’re facing.