I did .createIndex('abcIDX', ['A', 'B', 'C'])
.
However, I felt the results were strange, so I did the following tests.
// All methods except "IDBKeyRange.only()" are weird.;
const range = IDBKeyRange.lowerBound( [5,5,5] );
function test( arr ) {
console.log( range.includes(arr) );
}
test([5,5,5]); // case1: true
test([5,5,1]); // case2: false
test([5,6,1]); // case3: true ?
test([6,1,1]); // case4: true ??
test([1,6,1]); // case5: false ??
I thought IDBKeyRange
works as A && B && C
.
Cases 1 and 2 were right.
But cases 3 and 4 were not. So I guessed it works with ||
, not &&
.
However, cases 2 and 5 showed that the speculation was wrong.
Stackoverflow had a great answer. Here's what I understand after reading this answer.
It's work
A || (A && B) || (A && B && C)
.
However, case 2 showed that the speculation was wrong.
What am I wrong with? Or am I using it wrong? Help me plz...