You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/05/04 10:22:56 UTC
[GitHub] csantanapr commented on a change in pull request #3588: Make count
with skip to work with CouchDB
csantanapr commented on a change in pull request #3588: Make count with skip to work with CouchDB
URL: https://github.com/apache/incubator-openwhisk/pull/3588#discussion_r186042985
##########
File path: common/scala/src/main/scala/whisk/core/database/CouchDbRestStore.scala
##########
@@ -315,19 +315,14 @@ class CouchDbRestStore[DocumentAbstraction <: DocumentSerializer](dbProtocol: St
val start = transid.started(this, LoggingMarkers.DATABASE_QUERY, s"[COUNT] '$dbName' searching '$table")
val f = client
- .executeView(firstPart, secondPart)(
- startKey = startKey,
- endKey = endKey,
- skip = Some(skip),
- stale = stale,
- reduce = true)
+ .executeView(firstPart, secondPart)(startKey = startKey, endKey = endKey, stale = stale, reduce = true)
.map {
case Right(response) =>
val rows = response.fields("rows").convertTo[List[JsObject]]
val out = if (!rows.isEmpty) {
assert(rows.length == 1, s"result of reduced view contains more than one value: '$rows'")
- rows.head.fields("value").convertTo[Long]
+ rows.head.fields("value").convertTo[Long] - skip
Review comment:
![See why I added @dubee as a reviewer](https://media1.tenor.com/images/90d6be2b88ac2076e352f9f21256b3e0/tenor.gif?itemid=8235158)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services