跳到主要内容

IndexedDB🧪

✅️️ Methods

🔨IndexedDB.clearObjectStore

清除对象存储中的所有条目。

EN
Clears all entries from an object store.
参数必填标记类型描述原文
securityOriginstring至少且最多必须指定 securityOrigin、storageKey 或 storageBucket 中的一个。安全来源。
ENAt least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
storageKeystring存储键。
ENStorage key.
storageBucketStorage.StorageBucket存储桶。如果未指定,则使用默认桶。
ENStorage bucket. If not specified, it uses the default bucket.
databaseName✔️string数据库名称。
ENDatabase name.
objectStoreName✔️string对象存储名称。
ENObject store name.

🔨IndexedDB.deleteDatabase

删除一个数据库。

EN
Deletes a database.
参数必填标记类型描述原文
securityOriginstring至少且最多必须指定 securityOriginstorageKeystorageBucket 中的一个。安全来源。
ENAt least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
storageKeystring存储键。
ENStorage key.
storageBucketStorage.StorageBucket存储桶。如果未指定,则使用默认桶。
ENStorage bucket. If not specified, it uses the default bucket.
databaseName✔️string数据库名称。
ENDatabase name.

🔨IndexedDB.deleteObjectStoreEntries

从对象存储中删除一系列条目

EN
Delete a range of entries from an object store
参数必填标记类型描述原文
securityOriginstring至少且至多必须指定securityOrigin、storageKey或storageBucket中的一个。Security origin。
ENAt least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
storageKeystring存储键。
ENStorage key.
storageBucketStorage.StorageBucket存储桶。如果未指定,则使用默认存储桶。
ENStorage bucket. If not specified, it uses the default bucket.
databaseName✔️string
objectStoreName✔️string
keyRange✔️KeyRange要删除的条目键范围
ENRange of entry keys to delete

🔨IndexedDB.disable

禁用来自后端的事件。

EN
Disables events from backend.

🔨IndexedDB.enable

启用来自后端的事件。

EN
Enables events from backend.

🔨IndexedDB.getMetadata

获取对象存储的元数据。

EN
Gets metadata of an object store.
参数必填标记类型描述原文
securityOriginstring至少且至多必须指定 securityOrigin、storageKey 或 storageBucket 中的一个。安全来源。
ENAt least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
storageKeystring存储键。
ENStorage key.
storageBucketStorage.StorageBucket存储桶。如果未指定,则使用默认桶。
ENStorage bucket. If not specified, it uses the default bucket.
databaseName✔️string数据库名称。
ENDatabase name.
objectStoreName✔️string对象存储名称。
ENObject store name.
返回对象类型描述原文
entriesCountnumber条目数量
ENthe entries count
keyGeneratorValuenumber键生成器的当前值,将成为对象存储中下一个插入的键。仅在objectStore.autoIncrement为true时有效。
ENthe current value of key generator, to become the next inserted key into the object store. Valid if objectStore.autoIncrement is true.

🔨IndexedDB.requestData

从对象存储或索引中请求数据。

EN
Requests data from object store or index.
参数必填标记类型描述原文
securityOriginstring至少且最多必须指定 securityOrigin、storageKey 或 storageBucket 中的一个。安全来源。
ENAt least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
storageKeystring存储键。
ENStorage key.
storageBucketStorage.StorageBucket存储桶。如果未指定,则使用默认桶。
ENStorage bucket. If not specified, it uses the default bucket.
databaseName✔️string数据库名称。
ENDatabase name.
objectStoreName✔️string对象存储名称。
ENObject store name.
indexNamestring索引名称。如果未指定,则执行对象存储数据请求。
ENIndex name. If not specified, it performs an object store data request.
skipCount✔️integer要跳过的记录数量。
ENNumber of records to skip.
pageSize✔️integer要获取的记录数量。
ENNumber of records to fetch.
keyRangeKeyRange键值范围。
ENKey range.
返回对象类型描述原文
objectStoreDataEntriesarray[DataEntry]对象存储数据条目的数组。
ENArray of object store data entries.
hasMoreboolean如果为真,则在给定范围内还有更多条目需要获取。
ENIf true, there are more entries to fetch in the given range.

🔨IndexedDB.requestDatabase

在给定的框架中请求指定名称的数据库。

EN
Requests database with given name in given frame.
参数必填标记类型描述原文
securityOriginstring至少且最多必须指定 securityOrigin、storageKey 或 storageBucket 中的一个。安全来源。
ENAt least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
storageKeystring存储键。
ENStorage key.
storageBucketStorage.StorageBucket存储桶。如果未指定,则使用默认存储桶。
ENStorage bucket. If not specified, it uses the default bucket.
databaseName✔️string数据库名称。
ENDatabase name.
返回对象类型描述原文
databaseWithObjectStoresDatabaseWithObjectStores包含对象存储数组的数据库。
ENDatabase with an array of object stores.

🔨IndexedDB.requestDatabaseNames

为指定的安全源请求数据库名称。

EN
Requests database names for given security origin.
参数必填标记类型描述原文
securityOriginstring至少且至多必须指定 securityOrigin、storageKey 或 storageBucket 中的一个。安全来源。
ENAt least and at most one of securityOrigin, storageKey, or storageBucket must be specified. Security origin.
storageKeystring存储键。
ENStorage key.
storageBucketStorage.StorageBucket存储桶。如果未指定,则使用默认桶。
ENStorage bucket. If not specified, it uses the default bucket.
返回对象类型描述原文
databaseNamesarray[string]''和``内的内容保持不变,以下是翻译:
来源的数据库名称。
ENDatabase names for origin.

✅️️ Types

📌IndexedDB.DatabaseWithObjectStores

包含对象存储数组的数据库。

EN
Database with an array of object stores.

返回类型:object

属性必填标记类型描述原文
name✔️string数据库名称。
ENDatabase name.
version✔️number数据库版本(类型不是'integer',因为标准要求版本号必须是'unsigned long long')
ENDatabase version (type is not 'integer', as the standard requires the version number to be 'unsigned long long')
objectStores✔️array[ObjectStore]此数据库中的对象存储。
ENObject stores in this database.

📌IndexedDB.DataEntry

数据录入。

EN
Data entry.

返回类型:object

属性必填标记类型描述原文
key✔️Runtime.RemoteObject关键对象。
ENKey object.
primaryKey✔️Runtime.RemoteObject主键对象。
ENPrimary key object.
value✔️Runtime.RemoteObject值对象。
ENValue object.

📌IndexedDB.Key

Key

EN
Key.

返回类型:object

属性必填标记类型描述原文
type✔️string键类型。
允许的值:numberstringdatearray
ENKey type.
Allowed Values: number, string, date, array
numbernumber数值。
ENNumber value.
stringstring字符串值。
ENString value.
datenumber日期值。
ENDate value.
arrayarray[Key]数组值。
ENArray value.

📌IndexedDB.KeyPath

关键路径。

EN
Key path.

返回类型:object

属性必填标记类型描述原文
type✔️string关键路径类型。
允许的值:nullstringarray
ENKey path type.
Allowed Values: null, string, array
stringstring字符串值。
ENString value.
arrayarray[string]数组值。
ENArray value.

📌IndexedDB.KeyRange

键范围。

EN
Key range.

返回类型:object

属性必填标记类型描述原文
lowerKey下界。
ENLower bound.
upperKey上限。
ENUpper bound.
lowerOpen✔️boolean如果为真,下界是开放的。
ENIf true lower bound is open.
upperOpen✔️boolean如果为真,则上限是开放的。
ENIf true upper bound is open.

📌IndexedDB.ObjectStore

对象存储。

EN
Object store.

返回类型:object

属性必填标记类型描述原文
name✔️string对象存储名称。
ENObject store name.
keyPath✔️KeyPath对象存储键路径。
ENObject store key path.
autoIncrement✔️boolean如果为真,对象存储已设置自动递增标志。
ENIf true, object store has auto increment flag set.
indexes✔️array[ObjectStoreIndex]此对象存储中的索引。
ENIndexes in this object store.

📌IndexedDB.ObjectStoreIndex

对象存储索引。

EN
Object store index.

返回类型:object

属性必填标记类型描述原文
name✔️string索引名称。
ENIndex name.
keyPath✔️KeyPath索引键路径。
ENIndex key path.
unique✔️boolean如果为真,索引是唯一的。
ENIf true, index is unique.
multiEntry✔️boolean如果为 true,索引允许一个键对应多个条目。
ENIf true, index allows multiple entries for a key.