I need the total no. of records available for the condition to display like - "Page 1 of 'Total Records'" (I'm displaying data in a grid). According to Couchbase forums, sort count metrics should give me the total records but it gives me zero. Any help is highly appreciated. using the .NET SDK.
N1QL query used:
select Title
from `CMS`
where LastUpdatedOn > 0 and IsLatestVersion = true
order by LastUpdatedOn DESC LIMIT 2
Index used:
CREATE INDEX `CMS_idx_LastUpdatedOnDesc_IsLatestVersion` ON `CMS`(LastUpdatedOn DESC, IsLatestVersion);