From user-return-5852-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Fri Aug 07 10:56:34 2009 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 44436 invoked from network); 7 Aug 2009 10:56:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Aug 2009 10:56:34 -0000 Received: (qmail 46881 invoked by uid 500); 7 Aug 2009 10:56:40 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 46804 invoked by uid 500); 7 Aug 2009 10:56:40 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 46794 invoked by uid 99); 7 Aug 2009 10:56:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2009 10:56:40 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of somers.tim@gmail.com designates 209.85.211.190 as permitted sender) Received: from [209.85.211.190] (HELO mail-yw0-f190.google.com) (209.85.211.190) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Aug 2009 10:56:28 +0000 Received: by ywh28 with SMTP id 28so2255935ywh.27 for ; Fri, 07 Aug 2009 03:56:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:reply-to:received:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=CRR2lY6rl5u4yaSyF7LS9GuC8mCCrIwbLSr3GFNlh2k=; b=aPXF5PkENi9ByhCOE4+hWOT8LDf+4ofi43yyFTfvXQk5R863dP/nSf57uPzdgn43x5 RKV6NPCIqJwVmVcgE1AstQ6cM+qNCnExlb5BewIkS26//GCZAkjyzlUvlSgM4DyBAhVI +U5LBVB20/3bJb4zWEqcb70ydueQcFfn+V7pw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:from:date:x-google-sender-auth :message-id:subject:to:content-type; b=gZGRYl61fosfMThUPUKLv+Q7SU70aWkMuHaAmm/KmC9Q/a7QgtIcTyb2Np77NBudpp W1PLQIRrOz6FCwAXRimgALrVSYN6F3+SKXKmSGR3VmozBDToKvBMTYPZasQ+/OLBzUul GHPT0Ap0cjzAEA0ivtX0PJUU7nn7xFXHXyAok= MIME-Version: 1.0 Sender: somers.tim@gmail.com Reply-To: tim.somers@securysat.be Received: by 10.150.146.18 with SMTP id t18mr2155283ybd.211.1249642566077; Fri, 07 Aug 2009 03:56:06 -0700 (PDT) From: Tim Somers Date: Fri, 7 Aug 2009 12:55:46 +0200 X-Google-Sender-Auth: 7945b3b7234d5c30 Message-ID: <7fe7e0900908070355s4d53e7e6ycbdda54afe4527db@mail.gmail.com> Subject: Properties with special characters To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=000e0cd481583f4edf04708b1527 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cd481583f4edf04708b1527 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi all, I'm using couchdb to store some localization strings. A typical document looks like this: { "_id":"1962a07f8a56ba935f6d5370928dd483", "_rev":"3-2493355664", "default":"closed", "doc_type":"multiLangString", "fr-BE":"cl\u00f4tur\u00e9", "nl-BE":"afgesloten" } 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, "fr-BE": doc.fr-BE, "nl-BE": doc.nl-BE }); } } 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 {{bad_return_value,{os_process_error,{exit_status,0}}}, {gen_server,call, [<0.19293.25>, {prompt,[<<"add_fun">>, <<"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\": doc.fr\\-BE,\n\t\t\t\"nl-BE\": doc.nl\\-BE\n\t\t});\n\t}\n}\n\n">>]}, infinity]}} I'm using the 0.9.0 version from debian testing. Any idea how to get this view running? Thanks Tim --000e0cd481583f4edf04708b1527--