Limiting revisions on Couchbase Sync

I just checked the docs with ?open_revs=all and there were 2 leafs returned. Revision 1 and revision 1680. I guess that is why all the revisions in between were saved. On deleting the old leaf, the revs_limit is followed properly. Thanks for your help! :slight_smile:

Hi @Abhilash,

I havent looked into this for a while.
can you post the command you used to delete the leaf? Do I understand correctly that the number of revisions returned included all revisions of all leafs?

Best regards
Ulf

Hi @blanke,
This is the command I used:
http://1.1.1.1:6666/custombucket/custom_doc_id?open_revs=all

I read it somewhere on the couchbase Google group, cannot find the reference now. Apparently what it does is return only all leaf revisions of the particular document. It only returns last revision of each leaf. Something of this sort:

–cc60b50dbd410434ab65fe608f53778d9023d6ed100bd93c7983bd06ba75
Content-Type: application/json

{“_id”:“custom_doc_id”,“_rev”:“1-c1c47654dd39dbcfcf219e5e6977c678”,“body”:“body”}
–cc60b50dbd410434ab65fe608f53778d9023d6ed100bd93c7983bd06ba75
Content-Type: application/json

{“_id”:“custom_doc_id”,“_rev”:“1690-dc9f3927f635e548d1e519b1c1ef69da”,“body”:“body”}
–cc60b50dbd410434ab65fe608f53778d9023d6ed100bd93c7983bd06ba75–

What i did was delete the revision with the lower revision number and update the document. So the number of revisions now went down to revs_limit and ??_open_revs=all returned only the doc with revision number 1690. I tried executing the command again after a while though, and both the same revision numbers and docs came up.

Is what I am doing the right way to go about it? What exactly does ?_open_revs=all return?

Thanks in advance!

open_revs=all returns all non-tombstoned leaf revisions.

Can you provide some more details on what’s meant by: [quote=“Abhilash, post:23, topic:8590”]
I tried executing the command again after a while though, and both the same revision numbers and docs came up.
[/quote]

What command did you try to execute after a while, and what was the response?

@adamf, same issue we are facing. we had revision conflicts at 1st revision and we resolved by

https://developer.couchbase.com/documentation/mobile/current/guides/sync-gateway/resolving-conflicts/index.html

and we are resolving by current revision (the one that got picked deterministically by the system) remains the winner
when we update documents and looks like open_revs=all returning older revision which got deleted earlier.

below is _bulk_docs request body where revision 1-a42dc43aefec84c14cf854ecb4ec6995 was deleted earlier . but still we are receiving the same in every request of open_revs=all

{‘docs’: [{’_rev’: u’1-a42dc43aefec84c14cf854ecb4ec6995’, ‘_id’: u’3’, ‘_deleted’: True}, {u’ver’: u’dssdds’, u’_rev’: u’15-df476d53eb1caeaaee678f393296ed3b’, u’_id’: u’3’, u’type’: u’dd’}]}