Creates a new JavaScript ObjectStore object which interacts with the Fastly Object-store named name
.
Name of the Fastly Object-store to interact with. A name cannot be empty, contain Control characters, or be longer than 255 characters.
Gets the value associated with the key key
in the Object-store.
When the key is present, a resolved Promise containing an ObjectStoreEntry will be returned which contains the associated value.
When the key is absent, a resolved Promise containing null is returned.
The key to retrieve from within the Object-store. A key cannot:
Write the value of value
into the Object-store under the key key
.
Note: Object-store is eventually consistent, this means that the updated contents associated with the key key
may not be available to read from all
edge locations immediately and some edge locations may continue returning the previous contents associated with the key.
The key to associate with the value. A key cannot:
The value to store within the Object-store.
Generated using TypeDoc
Class for accessing a Fastly Object-store.
An object store is a persistent, globally consistent key-value store.
Note: Can only be used when processing requests, not during build-time initialization.
Example
In this example we connect to an Object Store named
'files'
and save an entry to the store under the key'hello'
and then read back the value and return it to the client.