incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Shorin <kxe...@gmail.com>
Subject Re: Problem with changes feed and style=all_docs
Date Mon, 30 Sep 2013 08:39:56 GMT
Hi Michael,

Are you sure that there are any conflicted leafs for the
81abd28f263b2046ddfc867247007275 document?

[~]$ curl -X PUT http://localhost:5984/conflicts
{"ok":true}

[~]$ curl -X PUT http://localhost:5984/conflicts/doc \
        -d '{"foo":"bar"}' \
        -H "Content-Type: application/json"
{"ok":true,"id":"doc","rev":"1-4c6114c65e295552ab1019e2b046b10e"}

[~]$ curl -X PUT http://localhost:5984/conflicts/doc\?new_edits\=false \
        -d '{"bar":"baz", "_rev": "1-078e832b49edb2a4b05b6d9ba627ff2f"}' \
        -H "Content-Type: application/json"
{"ok":true,"id":"doc","rev":"1-078e832b49edb2a4b05b6d9ba627ff2f"}

[~]$ curl http://localhost:5984/conflicts/_changes\?style\=main_only
{"results":[
{"seq":2,"id":"doc","changes":[{"rev":"1-4c6114c65e295552ab1019e2b046b10e"}]}
],
"last_seq":2}

[~]$ curl http://localhost:5984/conflicts/_changes\?style\=all_docs
{"results":[
{"seq":2,"id":"doc","changes":[{"rev":"1-4c6114c65e295552ab1019e2b046b10e"},{"rev":"1-078e832b49edb2a4b05b6d9ba627ff2f"}]}
],
"last_seq":2}

You may query document with meta=true query parameter to verify that
conflicts are exists for this document:

[~]$ curl http://localhost:5984/conflicts/doc\?meta\=true
{"_id":"doc","_rev":"1-4c6114c65e295552ab1019e2b046b10e","foo":"bar","_revs_info":[{"rev":"1-4c6114c65e295552ab1019e2b046b10e","status":"available"}],"_conflicts":["1-078e832b49edb2a4b05b6d9ba627ff2f"]}

--
,,,^..^,,,


On Mon, Sep 30, 2013 at 12:05 PM, Michael S <michael_489@hotmail.de> wrote:
> Hi together,
>
> I am using CouchDB Version 1.4.0 and the Changes Feed, but I have a litte
> problem with the style option
> (http://localhost:5984/db1/_changes?style=all_docs) in the query request.
> The JSON output does not return all leaf revisions in the changes array
> (including conflicts and deleted former conflictes) - which is mentioned in
> the official CouchDB documentation.
>
> Please see my example and the JSON output
> curl -X GET http://localhost:5984/db1/_changes?style=all_docs
> {"results":[
> {"seq":3,"id":"81abd28f263b2046ddfc867247007275","changes":[{"rev":"3-1a796ab41eeb8bafd3d6025a4b31928f"}]}
> ],
> "last_seq":3}
>
> The JSON output is also the same as with style=main_only and I can also
> query all revisions of the document _id
> 81abd28f263b2046ddfc867247007275.....
>
> Is this a known bug?
>
> Michael

Mime
View raw message