I posted this question on github initially as I was not aware of this forum.
Background:
In our mobile app, users can perform actions that can result in processing of the commands in the backend. When we establish a web socket connection to get pending commands (documents), a “since” value has to be provided. This since value has to be tracked somewhere, so that if service goes down, next time it starts from the last sequence that was processed. So I thought I’ll create a doc and after each command is processed, I’ll update value with a sequence of the document processed. Well what I found out, when looking at couchbase server is that it keeps track of each revision. As we are talking about millions of commands, that would yield a doc that is just huge. What I really need is just a document such as “_sync:seq”, or a doc, that does not have all that revision, history etc. just a field with a number.
Any guidance would be highly appreciated.
lastProcessedDocumentSequence doc
{
“value”: 6
"_sync": {
“rev”: “3-688542223bca3bb9d516eb2b5728826d”,
“sequence”: 8,
“recent_sequences”: [
2,
5,
8
],
“history”: {
“revs”: [
“1-f282563eb44318552395c7e34e734aa2”,
“2-8f1d4129dfd6eebf628bd751792bfdeb”,
“3-688542223bca3bb9d516eb2b5728826d”
],
“parents”: [
-1,
0,
1
],
“channels”: [
null,
null,
null
]
},
“time_saved”: “2017-08-30T18:45:00.2041133Z”
},
}