On Tue, May 13, 2008 at 3:04 PM, Jan Lehnardt <[EMAIL PROTECTED]> wrote:
>
> On May 13, 2008, at 23:19, Bob Briski wrote:
>
>> I've found that I can't create a view with a key that includes a document
>> key that doesn't exist in all documents.

You could try this simplification as a way to create a default value
in the case of undefined:

function(doc) {
  if(doc.type=="Performance") {
    map([doc.product_id, (doc.tracking_code||null), doc.date], doc);
  }
}

The use of || as a guard statement in this way ought to work just
fine. You can use anything you want instead of null as the default.

-- 
Chris Anderson
http://jchris.mfdz.com

Reply via email to