Hello,
With Couchbase SDK2, the ViewRow could be used as below to fetch the total docoment list size.
ViewQuery countQuery = ViewQuery
.from("status", "updated_datetime")
.stale(Stale.FALSE)
.startKey(createDatetime.getTime());
/**
* Execute count view
*/
List<ViewRow> countView = bucket.query(countQuery).allRows();
int totalItemCnt = (int) countView.get(0).value();
In SDK 3, i have tried to change the code as below
List<ViewRow> countView = bucket.viewQuery(
"status",
"updated_datetime",
ViewOptions
.viewOptions()
.scanConsistency(ViewScanConsistency.REQUEST_PLUS).startKey(createDatetime.getTime()))
.rows();
int totalItemCnt = (int) countView.get(0).value();
However, I am getting compilation error as below:
Cannot resolve method ‘value’ in ‘ViewRow’. How can i fix this in Couchbase SDK3 ?