incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Somers <>
Subject Properties with special characters
Date Fri, 07 Aug 2009 10:55:46 GMT
Hi all,

I'm using couchdb to store some localization strings. A typical document
looks like this:


So far, so good. Now, I'm trying to get a view running with all translations
ordered by "default" :

function(doc) {
    if (doc.doc_type == "multiLangString") {
        emit(doc.default, {
            "default": doc.default,
            "en-GB": doc.en-GB,

This version just gives nothing at all. If I remove the "-" from the field
names (enGB, frBE and nlBE) it outputs only the default values, as expected.
If I adapt the documents it works like it should, except for my application
which is trying to reusing an existing variable. If I try escaping (en\-GB,
nl\-BE and fr\-BE), I get an error :

Error: badmatch

                       <<"function(doc) {\n\tif (doc.doc_type ==
\"multiLangString\") {\n\t\temit(doc.default, {\n\t\t\t\"default\":
doc.default,\n\t\t\t\"en-GB\": doc.en\\-GB,\n\t\t\t\"fr-BE\":\\-BE,\n\t\t\t\"nl-BE\":\\-BE\n\t\t});\n\t}\n}\n\n">>]},

I'm using the 0.9.0 version from debian testing. Any idea how to get this
view running?


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message