I use Couchdb 1.1.1 in Debian testing
and I have this design document in database
{
"_id": "_design/Page",
"_rev": "9-1944cdebabf20ae569eab7b534b43e67",
"views": {
"all": {
"map": "function(doc) {}"
}
},
"language": "javascript"
}
but still I get in http://localhost:5984/db_development/_design/Page/_view/all
this {"error":"compilation_error","reason":"Expression does not eval to a function. ((new String(\"function(doc) {}\")))"}
I tried to run different simple map functions in spidermonkey-bin interpreter and they was loaded correctly, but same error in couchdb
I really can't see, where problem is....
Ok, in mailing list I found that it is needed to wrap function to parentheses "()", because something has changed in newer spidermonkey
So map function looks like this: "map": "(function(doc) { emit([doc._id, doc._rev]);})"
Ok, in mailing list I found that it is needed to wrap function to parentheses "()", because something has changed in newer spidermonkey
So map function looks like this: "map": "(function(doc) { emit([doc._id, doc._rev]);})"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With