You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2022/08/20 08:27:57 UTC
[GitHub] [couchdb] janl commented on a diff in pull request #4152: Fix Partition All Docs Query With Keys
janl commented on code in PR #4152:
URL: https://github.com/apache/couchdb/pull/4152#discussion_r950668273
##########
src/fabric/src/fabric_view_all_docs.erl:
##########
@@ -286,6 +286,20 @@ all_docs_concurrency() ->
10
end.
+validate_if_partition(Row, Acc) ->
+ QueryStr = Acc#vacc.req#httpd.qs,
+ case QueryStr of
+ undefined -> Row;
+ [{"partition", Id}] -> is_doc_in_partition(Row, Id)
+ end.
+is_doc_in_partition(Row, Id) ->
+ BinRowId = element(2, Row),
Review Comment:
the more idiomatic way of doing this in Erlang would be:
```
{_, BinRowId, _, _, _, _} = Row,
```
but I’m not 100% that that’s actually better. I think maybe on revising the code it is nicer to know the explicit row structure rather than having to know the id is in location 2.
--
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: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org