I'm having some problems with a document in couch DB because I can't update this document without the conflict error. The DB is used on single node
When I try to get the document directly by the url I get different revisions, based on the way I try to get this doc.
When I make a request by the Id I get the new version: http://localhost:5984/my_db/a38f88a5f34e0be1fed424abfb02eefb
{
"_id": "a38f88a5f34e0be1fed424abfb02eefb",
"_rev": "14-7d6c2bd805fb124be923f8ae755e52ed",
"$doctype": "docType"
}
But when I make a request using a view I get the old version http://localhost:5984/my_db/_design/des_doc/_view/some_view?key=%22a38f88a5f34e0be1fed424abfb02eefb%22
{
"id": "a38f88a5f34e0be1fed424abfb02eefb",
"key": "a38f88a5f34e0be1fed424abfb02eefb",
"value": {
"_id": "a38f88a5f34e0be1fed424abfb02eefb",
"_rev": "13-b16eef70a8247298259d293d940edd9a",
"$doctype": "scale"
}
}
Why this is happening?
EDIT: conflicts=true does not change the result revs_info=true has this output
"_revs_info":[
{"rev":"14-048c3d19d53fa1477ebc33d45914dd26","status":"available"},
{"rev":"13-b16eef70a8247298259d293d940edd9a","status":"missing"}
]
EDIT2: I was under the impression that the problem here was that the views were not getting the new version of the docs. I can't see why this happened. But forcing the views to be refreshed, by making small changes to the code, solved the problem.