         callback results
     return
   
+  count : (storeName, callback) ->
+    trans = @db.transaction [storeName], "readonly"
+    store = trans.objectStore storeName
+    request = store.count()
+    request.onsuccess = (event) ->
+      callback event.target.result
+      
   deleteDB : () ->
     @db.close()
     request = indexedDB.deleteDatabase @dbName

    results = new Array
    trans = @db.transaction [query.storeName], "readonly"
    store = trans.objectStore query.storeName
    index = store.index query.key
   
    index.openCursor(query.keyRange).onsuccess = (event) ->
      cursor = event.target.result
      if cursor?

    request.onsuccess = (event) ->
      #console.log "#{value} [STORED]"
      if callback?
        callback event.target.result
      return
    
    request.onerror = @onerror
