CouchDb newbie here.
I have several documents in CouchDb with the same structure:
{
"_id": "1170140286",
"_rev": "1-79ffad4d4cbe24effc72f9ec519373ca",
"data": [
{
"photo": "link_of_photo1",
"userid": "34623",
"username": "guest-user1"
},
{
"photo": "link_of_photo2",
"userid": "34623",
"username": "guest-user1"
},
{
"photo": "link_of_photo3",
"userid": "34623",
"username": "guest-user1"
}
]
}
and
{
"_id": "43573458",
"_rev": "1-0ca5aa68590fcb58399fe059aa8fb881",
"data": [
{
"photo": "link_of_photo1",
"userid": "6334",
"username": "guest-user2"
},
{
"photo": "link_of_photo2",
"userid": "6334",
"username": "guest-user2"
},
{
"photo": "link_of_photo3",
"userid": "6334",
"username": "guest-user2"
}
]
}
I don't know whether what I want to do is possible, but i am trying to create a view that will combine the data elements of these documents into one single document:
[
{
"photo": "link_of_photo1",
"userid": "34623",
"username": "guest-user1"
},
{
"photo": "link_of_photo2",
"userid": "34623",
"username": "guest-user1"
},
{
"photo": "link_of_photo3",
"userid": "34623",
"username": "guest-user1"
},
{
"photo": "link_of_photo1",
"userid": "6334",
"username": "guest-user2"
},
{
"photo": "link_of_photo2",
"userid": "6334",
"username": "guest-user2"
},
{
"photo": "link_of_photo3",
"userid": "6334",
"username": "guest-user2"
}
]
I am pretty sure I haven't understood the logic of couchdb correctly, so any help is highly aprpeciated.