How to Count Records in an IndexedDB Transaction
To get the count of the results from the given transaction, you can use the 'count()' method instead of 'getAll()'. Here's the updated code:
dbo.transaction(['orders'], 'readonly').objectStore('orders').index('serviceid, status').count([window['serviceid'], 0]);
This will return the count of the records matching the specified criteria.
原文地址: https://www.cveoy.top/t/topic/o2pu 著作权归作者所有。请勿转载和采集!