I tried to test couchDB’s _revs_diff api to get document revisions. Here is the command I used
curl -X POST http://******:******@localhost:5984/grocery-sync/_revs_diff -H "Content-type:application/json"
the result is
{"error":"unknown_error","reason":"badarg"}
Does anyone know the reason for that?
According to the CouchDB wiki page,
_revs_diffwill return a value if the revisions for a given document are invalid. No examples usingcurlare given.Looking at this mailing list posting the problem appears to be that you need to include document and revision information, like this:
Where the dictionary key (
0d63...cf4d) is the document id and the array are revision ids. In this example both revisions (1-...and12-...) are present in the database so the response isIf I provide a missing revision id (one I invented):
The response is