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.

dbotransactionorders readonlyobjectStoreordersindexserviceid statusgetAllwindowserviceid 0; i only need the count

原文地址: https://www.cveoy.top/t/topic/hzCs 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录