Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IndexedDB: limit selected fields of retrieving object

Tags:

indexeddb

While getting object(s) from indexeddb is it possible to limit a set of fields being retrieved (not to fetch a whole data piece)? I believe an actual task when you have large objects in store, but need only small part of data for a particular operation.

like image 221
WHITECOLOR Avatar asked Sep 03 '25 04:09

WHITECOLOR


2 Answers

No, according to the IndexedDB spec you'll always get the full object, see: 3.4.2 Object Store Retrieval Operation.

like image 135
Aaron Powell Avatar answered Sep 04 '25 23:09

Aaron Powell


as a workaround it's possible to define a key on those fields and then do getAllKeys

like image 38
user656449 Avatar answered Sep 05 '25 01:09

user656449