Python - kv.keys()
Get a value from a key value store.
from nitric.resources import kvfrom nitric.application import Nitricprofiles = kv('profiles').allow('get')for await key in profiles.keys():# Do something with the keyNitric.run()
Parameters
- Name
key
- Required
- Required
- Type
- string
- Description
The key that references the key value pair that should be retrieved.
Examples
Get a key value pair
from nitric.resources import kvfrom nitric.application import Nitricprofiles = kv('profiles').allow('get')for await key in profiles.keys():# Do something with the keyNitric.run()
Filter by a prefix
from nitric.resources import kvfrom nitric.application import Nitricprofiles = kv('profiles').allow('get')# search for keys beginning with "profile:"for await key in profiles.keys("profile:"):# Do something with the keyNitric.run()
Last updated on Nov 18, 2024