nickva commented on code in PR #4703:
URL: https://github.com/apache/couchdb/pull/4703#discussion_r1311046408
##########
src/fabric/src/fabric_rpc.erl:
##########
@@ -299,6 +299,10 @@ update_docs(DbName, Docs0, Options) ->
Docs2 = make_att_readers(Docs1),
with_db(DbName, Options, {couch_db, update_docs, [Docs2, Options, Type]}).
+get_purged_infos(DbName) ->
+ FoldFun = fun({_Seq, _UUID, Id, Revs}, Acc) -> {ok, [{Id, Revs} | Acc]}
end,
+ with_db(DbName, [], {couch_db, fold_purge_infos, [0, FoldFun, []]}).
Review Comment:
Perhaps the better option is to return to using a list of purge infos. It
won't mirror the _purge json body but we can at least make it have the same
shape as _all_docs:
```
{
"purged_infos": [
{
"id": "doc1",
"revs": ["2-b5...", "3-08..."]
},
{
"id": "doc2",
"revs": ["1-f2..."]
},
{
"id": "doc1",
"revs": ["4-3a...", "4-e9..."]
}
}
```
This leaves us the option of adding a `seq` or `last_seq` alongside
"purged_infos"s later, or add a `"uuid"` or `"seq"` field to each purge info.
What do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]