Creating
Creating a new key-value for a file can be done in two ways:Uploading a File
By including the key-values as part of the upload method or endpoint and the file and the key-values will be created at the same time.Updating an Existing File
If you’ve already uploaded a file and want to add a key-value you can do so with the update method or endpoint.Retrieving
Since key-values exist with files, you can retrieve them by listing files either through the SDK method or API endpoint, and filtering results by key-value. The operator will always be===
.
You can chain multiple key-value queries together and it will only return files that meet both values.
Updating
The key-value system will automatically detect if you are replacing an existing value for a given key. For example, if you have a key ofenv
with a value of prod
, if you make an update of env: "dev"
it will replace the old value. If the key does not exist then it will make a new key-value entry.
Deleting
You can remove a key-value entry by making the valuenull
.