I expect it is actually the reduce
function that is complicating things for you here. I think your first entry (where you get the object with "value": 20
) is more or less what I would expect to see from a plain query of the view (because all of the mapped entries get reduced down to just the _count
).
This is what it looks like to me to open the view in Fauxton (can see the doc ids of the conflicted docs):
However, if you just want to hit the view endpoint directly (e.g. with curl), you should set the reduce=false
query parameter and as noted in the Couch docs you will just get back all the mapped values (/medic/_design/medic-conflicts/_view/conflicts?reduce=false
)