On Fri, Aug 7, 2009 at 13:09, Antony Blakey <[email protected]> wrote:
>
> On 07/08/2009, at 8:25 PM, Tim Somers wrote:
>
> 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
>> });
>> }
>> }
>>
>
> In javascript, doc.en-GB is actually doc.en - GB i.e. a subtration
> operation.
>
> You need to do this:
>
> "en-GB": doc['en-GB'],
> "fr-BE": doc['fr-BE'],
> "nl-BE": doc['nl-BE']
>
> This is a general Javascript trap.
>
> Antony Blakey
> --------------------------
> CTO, Linkuistics Pty Ltd
> Ph: 0438 840 787
>
> Isn't it enough to see that a garden is beautiful without having to believe
> that there are fairies at the bottom of it too?
> -- Douglas Adams
>
>
That's what I thought, hence the \- part. I didn't know this syntax though,
thank for the help!
Tim