Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4F8287DBF for ; Wed, 28 Sep 2011 19:06:05 +0000 (UTC) Received: (qmail 19760 invoked by uid 500); 28 Sep 2011 19:06:03 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 19613 invoked by uid 500); 28 Sep 2011 19:06:03 -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 19604 invoked by uid 99); 28 Sep 2011 19:06:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Sep 2011 19:06:03 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of andoriyu@gmail.com designates 209.85.213.180 as permitted sender) Received: from [209.85.213.180] (HELO mail-yx0-f180.google.com) (209.85.213.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Sep 2011 19:05:55 +0000 Received: by yxm34 with SMTP id 34so10250170yxm.11 for ; Wed, 28 Sep 2011 12:05:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=ez8vfNSk1j5ala0gW1RdTEndbeeMpWYmdOnekgKktPo=; b=r5J4jjg3KJQwCf8q+/KrtN2h1pH8KQ7ZEfT5aoboMJWqusvlzFoiTS+tEtiWn/QYFb oZG6gTJHUvfiERF0KIhUgbrEumqHxA2ayEXjm87YSPlnS2s7okae+EbZuHTojgcl5LXJ IZ1lNoQ7BnX4shBHWUWrBGr/L4DO0AklQFNhA= Received: by 10.68.33.130 with SMTP id r2mr46121500pbi.71.1317236734561; Wed, 28 Sep 2011 12:05:34 -0700 (PDT) Received: from [192.168.1.13] (ip98-185-255-2.sb.sd.cox.net. [98.185.255.2]) by mx.google.com with ESMTPS id h5sm10398129pbf.4.2011.09.28.12.05.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Sep 2011 12:05:33 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1249) Subject: Make a three From: Andrey Cherkashin In-Reply-To: Date: Wed, 28 Sep 2011 12:05:30 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <0A28DA04-6A54-4279-B8FC-D945EEC5268E@gmail.com> References: To: user@couchdb.apache.org X-Mailer: Apple Mail (2.1249) I have a bunch of documents, and I would like to build a three based on = data from them. For example I have objects like this: [{=20 name: "1", category: "Paint", sub_category: "Inside", brand: "ACME" }, {=20 name: "2", category: "Paint", sub_category: "Inside", brand: "ACME" }, {=20 name: "asd", category: "Tools", sub_category: "Hammer", brand: "ACME" }, {=20 name: "asd", category: "Tools", sub_category: "Hammer", brand: "UY" }, {=20 name: "asd", category: "Paint", sub_category: "Outside", brand: "UY" }] And I would like to build a three like this:=20 [ {category: "Paint", subs: ["Inside", "Outside"], brands: ["ACME", "UY"]=20 }, { category: "Tools", subs:["Hammer"], brands: ["ACME", "UY"] }] Is it possible to build in inside couch? Or Move it to middleware?=