A unique and powerful feature included with the IPFS API and Private IPFS API is the key-value store. Anytime you upload or update a file you can store up to 10 key-value pairs.Documentation Index
Fetch the complete documentation index at: https://pinata-fix--redirect--docs-to--quickstart.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
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===.
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.
Further Reading
Check out some of our reading material on some of the possibilities of key-values and file-centric architecture!
Pinata’s KV Store - A File-Centric Database
