How do you query IndexedDB products by price range?

Tests IndexedDB indexing and range query APIs. You need a price index created in onupgradeneeded, then IDBKeyRange.bound(50, 100) with index.getAll or openCursor. Red flag: fetching all records and filtering in JavaScript.
Tests practical IndexedDB schema design and efficient range retrieval. A strong answer describes creating a price index inside the onupgradeneeded handler, then opening a readonly transaction on that index, constructing IDBKeyRange.bound(50, 100, false, false) to include both endpoints, and calling getAll for simplicity or openCursor for memory-efficient streaming. Red flag: loading the entire object store into memory and filtering manually, which defeats the purpose of a structured database and kills performance on large datasets.
Read the original → developer.mozilla.org
- #indexeddb
- #web-apis
- #browser-storage
- #performance
- #typescript
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.