Q:

How to get Top 1 row from IndexedDB

Is there a way to get just top one row in IndexedDB? I could not find anything for it. 

A:

Using a cursor and not calling .continue() isn't a hack at all. It's the intended way. On of the main points of cursors is exactly that they let you only fetch the information that you need.
So no need to call transaction.abort()

A:

Since I could not find anything so this is what I have had put in place now and it works great for my purpose. It is a hack and I'm not happy with it, but hey, for now, this will do.
I'm just storing one row as that I need in that database. And on read, I get all the rows and perform the action I need, which is only one row. When I'm inserting a new row, I'm just clearing the entire database, which is again only one row and inserting a fresh row in it.
@spiderdevil, I just saw your answer and am not sure if I will be able to try aborting the transaction, but if it works for anyone else for sure, please do share it in comments.

