For counting all KiiObjects in a bucket, use the count() method. For counting the number of KiiObjects that satisfy a specific query condition, use the countWithQuery() method.
These methods count KiiObjects that are accessible to the current user. Those that are not accessible because of the ACL setting are not counted.
The performance of the count operation can deteriorate if there are numerous KiiObjects. See Performance for more information.
Counting all KiiObjects in a bucket
You can get the number of KiiObjects in a bucket with the following sample code:
Counting KiiObjects in a bucket with a query condition
You can get the number of KiiObjects that satisfy a query condition in a bucket with the following sample code. Suppose you have a bucket named "people" and want to know the number of KiiObjects that have a value of 25 or higher for the "age" field.