598 CHAPTER 16 Offline web applications
■■lowerOpen Optional; can be true or false. If true, the lower end of the range is
considered bounded, so the lower bound won’t be included in the results. If false,
it’s considered unbounded, and the lower bound will be included in the results.
■■upperOpen Optional; can be true or false. If true, the upper bound won’t be
included in the results. If false, it will be included.
For example, consider an index on the lastName property on the authors object store.
Following are some results in scenarios when ranges are applied against that index.
authors content: Daniel Defoe, Herman Melville, Mark Twain, Jules Verne
index.openCursor(IDBKeyRange.bound('Defoe', 'Verne', false, false));
results: Daniel Defoe, Herman Melville, Mark Twain, Jules Verne
index.openCursor(IDBKeyRange.bound('Defoe', 'Verne', false, true));
results: Daniel Defoe, Herman Melville, Mark Twain
index.openCursor(IDBKeyRange.bound('Defoe', 'Verne', true, false));
results: Herman Melville, Mark Twain, Jules Verne
index.openCursor(IDBKeyRange.bound('Defoe', 'Verne', true, true));
results: Herman Melville, Mark Twain
■■upperBound The upperBound method enables you to limit only the upper side of
the range. The following are parameters of the upperBound method.
■■upper pecifies the upper bound of the range.S
■■upperOpen Optional; can be true or false. If true, the upper bound won’t be
included in the results. If false, it will be included.
authors content: Daniel Defoe, Herman Melville, Mark Twain, Jules Verne
index.openCursor(IDBKeyRange.upperBound('Verne', false));
results: Daniel Defoe, Herman Melville, Mark Twain, Jules Verne
index.openCursor(IDBKeyRange.upperBound('Verne', true));
results: Daniel Defoe, Herman Melville, Mark Twain
■■lowerBound The lowerBound method enables you to limit only the lower end of the
range. The following are parameters of the lowerBound method.
■■lower Specifies the lower bound of the range.
■■lowerOpen Optional; can be true or false. If true, the lower bound won’t be
included in the results. If false, it will be included.
authors content: Daniel Defoe, Herman Melville, Mark Twain, Jules Verne
index.openCursor(IDBKeyRange.lowerBound('Defoe', false));
results: Daniel Defoe, Herman Melville, Mark Twain, Jules Verne