incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrey Cherkashin <andor...@gmail.com>
Subject Make a three
Date Wed, 28 Sep 2011 19:05:30 GMT
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:
[{ 
name: "1",
category: "Paint",
sub_category: "Inside",
brand: "ACME"
},
{ 
name: "2",
category: "Paint",
sub_category: "Inside",
brand: "ACME"
},
{ 
name: "asd",
category: "Tools",
sub_category: "Hammer",
brand: "ACME"
},
{ 
name: "asd",
category: "Tools",
sub_category: "Hammer",
brand: "UY"
},
{ 
name: "asd",
category: "Paint",
sub_category: "Outside",
brand: "UY"
}]

And I would like to build a three like this: 

[ {category: "Paint",
subs: ["Inside", "Outside"],
brands: ["ACME", "UY"] 
},
{
category: "Tools",
subs:["Hammer"],
brands: ["ACME", "UY"]
}]

Is it possible to build in inside couch? Or Move it to middleware?
Mime
View raw message