Github user ricellis commented on a diff in the pull request:

    https://github.com/apache/bahir/pull/61#discussion_r159847773
  
    --- Diff: 
sql-cloudant/src/main/scala/org/apache/bahir/cloudant/CloudantConfig.scala ---
    @@ -54,20 +147,21 @@ class CloudantConfig(val protocol: String, val host: 
String,
         createDBOnSave
       }
     
    -  def getLastNum(result: JsValue): JsValue = (result \ "last_seq").get
    +  def getClientUrl: URL = {
    +    new URL(protocol + "://" + host)
    +  }
    +
    +  def getLastNum(result: JsonObject): JsonObject = 
result.get("last_seq").getAsJsonObject
     
       /* Url containing limit for docs in a Cloudant database.
       * If a view is not defined, use the _all_docs endpoint.
       * @return url with one doc limit for retrieving total doc count
       */
       def getUrl(limit: Int, excludeDDoc: Boolean = false): String = {
    --- End diff --
    
    The comment suggests that this method is used to get a URL with a `limit=1` 
for the purposes of getting a doc count, but then it is not used by 
`getTotalDocCount` it does however appear to be used by `getMany` with a 
different limit for query results.
    FWIW I can't see `getTotalDocCount` being called anywhere in the new code 
either.


---

Reply via email to