indexdb get by key

indexdb get by key

hi guys i try to retrive data using key and indexdb ... but with my code i show entire database not only record or colums of key... i study a lot but help  me to understand how retrive this value i attach a screenshot of db..! Regards

Here is code :

var dbRequest ='newdbmed', 1);
dbRequest.onsuccess = function(event) {
  // works exactly the same way.
  var db = this.result;
var db = dbRequest.result;
  var db =;
var transaction = db.transaction(['user'], 'readonly');
  var objectStore = transaction.objectStore('user');

  var myIndex = objectStore.index('nome'); 
  var getRequest = myIndex.get('bond');
  getRequest.onsuccess = function() {

  myIndex.openCursor().onsuccess = function(event) {
    var cursor =;
    if(cursor) {
      alert(cursor.value.nome + cursor.value.cognome + cursor.value.farmaco + cursor.value.dosaggio +;

      else {
      alert("Entries all displayed.");    


Downloadimage/png Cattura.PNG65.36 KB
2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Daniele -- this is not a good forum for pure HTML5 questions, we are staffed to help you with the issues and problems associated with building and deploying Cordova apps on mobile devices. For questions related to how to use standard HTML5 features work you're better off searching the Stack Overflow and HTML5 Rocks web sites. For example, this search > < might have some useful articles that will help you.

Leave a Comment

Please sign in to add a comment. Not a member? Join today