I have 2 documents:
-
{ path: “/monster/green”, name: “Green monster”, age: 105, timeline: 1 }
-
{ path: “/monster/green” name: “Really Green Monster”, timeline: 2 }
The question:
How can I create a CouchDB view, where the documents are sorted by ‘timeline’ and the result is a combination of them:
{ path: “/monster/green”, name: “Really Green Monster”, age: 105 }
You can easily create a view which will give you the following output for
key="/monster/green":Except the format, this is really similar to the data you wanted.
If you really need to change the format, you can define a
liston top of yourview.