Finding if a value already exists in the indexedDB
===

I am working in IndexedDB. I am able to create, populate and delete the values in my jquery mobile app. 

Now when I come to a page for the first time I should check whether the value is available in my DB. If so I need to display "Exists" or "Not Exists" if it doesnt. I have written the below code :

    myapp.indexedDB.existsInFavourites = function(value){
		var db = myapp.indexedDB.db;
		var request = db.transaction(["todo"]).objectStore("todo").get(typeid);
		request.onerror = function(event) {
		  // Handle errors!
		};
		request.onsuccess = function(event) {
		  // Do something with the request.result!
		  
		};
	  }

which results me in the below error

    Uncaught TypeError : Cannot call method 'transaction' of null

Any Suggestion would be of great Help. Thanks in Advance!!!