← Back to IndexedDB domain
IndexedDB.getMetadata
Gets metadata of an object store.
Domain: IndexedDB
experimental
Parameters
| Name | Type | Description |
securityOrigin (optional) | string | At least and at most one of securityOrigin, storageKey, or storageBucket must be specified.
Security origin. |
storageKey (optional) | string | Storage key. |
storageBucket (optional) | Storage.StorageBucket | Storage bucket. If not specified, it uses the default bucket. |
databaseName | string | Database name. |
objectStoreName | string | Object store name. |
Returns
| Name | Type | Description |
entriesCount | number | the entries count |
keyGeneratorValue | number | the current value of key generator, to become the next inserted
key into the object store. Valid if objectStore.autoIncrement
is true. |
Example Request
{
"id": 1,
"method": "IndexedDB.getMetadata",
"params": {
"databaseName": "databaseName-value",
"objectStoreName": "objectStoreName-value"
}
}
Example Response
{
"id": 1,
"result": {
"entriesCount": 1.0,
"keyGeneratorValue": 1.0
}
}
Usage in Node.js
const result = await send('IndexedDB.getMetadata', {"databaseName": "databaseName-value", "objectStoreName": "objectStoreName-value"});
console.log(result);
// {"entriesCount": 1.0, "keyGeneratorValue": 1.0}