KeyValueStoreClient
Hierarchy
- ResourceClient- KeyValueStoreClient
 
Index
Properties
inheritedapifyClient
inheritedbaseUrl
inheritedhttpClient
optionalinheritedid
optionalinheritedparams
inheritedpublicBaseUrl
inheritedresourcePath
optionalinheritedsafeId
inheritedurl
Methods
createKeysPublicUrl
- Parameters- options: KeyValueClientCreateKeysUrlOptions = {}
 - Returns Promise<string>
delete
- Returns Promise<void>
deleteRecord
- Parameters- key: string
 - Returns Promise<void>
get
- Returns Promise<undefined | KeyValueStore>
getRecord
- You can use the - bufferoption to get the value in a Buffer (Node.js) or ArrayBuffer (browser) format. In Node.js (not in browser) you can also use the- streamoption to get a Readable stream.- When the record does not exist, the function resolves to - undefined. It does NOT resolve to a- KeyValueStorerecord with an- undefinedvalue. https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record- Parameters- key: string
 - Returns Promise<undefined | KeyValueStoreRecord<JsonValue>>
getRecordPublicUrl
- Generates a URL that can be used to access key-value store record. - If the client has permission to access the key-value store's URL signing key, the URL will include a signature to verify its authenticity. - Parameters- key: string
 - Returns Promise<string>
listKeys
- Parameters- options: KeyValueClientListKeysOptions = {}
 - Returns Promise<KeyValueClientListKeysResult>
recordExists
- Tests whether a record with the given key exists in the key-value store without retrieving its value. - https://docs.apify.com/api/v2#/reference/key-value-stores/record/get-record - Parameters- key: string- The queried record key. 
 - Returns Promise<boolean>- trueif the record exists,- falseif it does not.
setRecord
- The value in the record can be a stream object (detected by having the - .pipeand- .onmethods). However, note that in that case following redirects or retrying the request if it fails (for example due to rate limiting) isn't possible. If you want to keep that behavior, you need to collect the whole stream contents into a Buffer and then send the full buffer. See this StackOverflow answer for an example how to do that.- https://docs.apify.com/api/v2#/reference/key-value-stores/record/put-record - Parameters- record: KeyValueStoreRecord<JsonValue>
- options: KeyValueStoreRecordOptions = {}
 - Returns Promise<void>
update
- Parameters- newFields: KeyValueClientUpdateOptions
 - Returns Promise<KeyValueStore>
Generates a URL that can be used to access key-value store keys.
If the client has permission to access the key-value store's URL signing key, the URL will include a signature which will allow the link to work even without authentication.
You can optionally control how long the signed URL should be valid using the
expiresInSecsoption. This value sets the expiration duration in seconds from the time the URL is generated. If not provided, the URL will not expire.Any other options (like
limitorprefix) will be included as query parameters in the URL.