You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in version 2.1.0 I was able to get the result with the following code:
database.queryByView("count_doc", ofDesign: "mydesign", usingParameters: []) { (doc, err) in
if let doc = doc, err == nil {
if let count = doc["rows"][0]["value"].int {
completion(count, nil)
} else {
completion(0, nil)
}
} else {
completion(nil, err)
}
}
Now in the current version:
database?.queryByView("count_doc", ofDesign: "mydesign", usingParameters: []) { (doc, err) in
if let doc = doc, err == nil {
if let count = doc.total_rows {
completion(count, nil)
} else {
completion(0, nil)
}
} else {
completion(nil, err)
}
}
I get the error
Failed to decode AllDatabaseDocuments from response
which is correct since the result is something like {"rows":[ {"key":null,"value":26} ]}
Can you tell me how to retrieve the result from this view or a view that contains "_stats" function ?
The text was updated successfully, but these errors were encountered:
I have the following view :
in version 2.1.0 I was able to get the result with the following code:
Now in the current version:
I get the error
which is correct since the result is something like
{"rows":[ {"key":null,"value":26} ]}
Can you tell me how to retrieve the result from this view or a view that contains "_stats" function ?
The text was updated successfully, but these errors were encountered: