0

In WebSQL, I have this code

tx.executeSql('select * from TABLE where FIELD IN (? ,? ,?) ;', ['REGULAR', 'FULL' , 'CONTRACTUAL' ])

Is there a similar construct in IndexedDB? I was looking at the IDBKeyRange.bound but just would like to make sure that it will match up.

Mark Estrada
  • 9,013
  • 37
  • 119
  • 186

1 Answers1

2

You cannot perform the equivalent of field = value1 or field = value2 in indexedDB.

Off the top of my head, here is a workaround. Use integer constants to represent the categories of FIELD. For example, 1 for REGULAR, 2 for FULL, and 3 for CONTRACTUAL. Order the constants such that the numbers are consecutive. Then use IDBKeyRange with lower bound on the lowest desired constant and upper bound on the highest constant.

Josh
  • 17,834
  • 7
  • 50
  • 68