I have a simple Dexie table search function that I want to return the searched item after the searching code is actually run
function ReturnItemFromTable() {
db.table1
.where('field1')
.equals('some value')
.first(function(item) {
return item
}
}
So I know the 'return' in the above code is in the wrong place for the function to know it's supposed to be returned. But if I put it in the right place it gets returns before the table.where has had a chance to run and thus returns undefined.
Is there a way to get this ordering done right?
Thanks, Frank