YDN-DB How to verify if a record exists?
问题 I'm trying to verify if a specific record exist inside a table by a given ID. For example: var id = 23; db.count('products',id).done(function(count) { if(count>0){ db.get('products',id).done(function(r) { //Do something }); }else{ alert('No product found'); } }); When I try this, I get the following error: uncaught exception: null I'd really appreciate your help Thanks!. 回答1: Your solution is almost correct. In IndexedDB API, there is no exists method, probably because it can be emulated