Suppose i have a table in indexdb which has two columns - name and salary and i have seperate index on both.
now i have obtained result using cursor and range on index name like this -
var value ="ujjwal";
var trans = db.transaction(['employee'], "readonly");
var store = trans.objectStore('employee');
var index = store.index('name');
var cursorRequest = index.openCursor(IDBKeyRange.only(value)),
res = new Array();
cursorRequest.onsuccess = function(e) {
var cursor = e.target.result;
if (cursor) {
res.push(cursor.value);
cursor.continue();
}
};
so now i got multiple results. How can i sort them on salary.
I want to do this using IndexedD.I have already index on salary column.