All Topics
All Topics
Technology
Technology
AI
AI
Business
Business
Entertainment
Entertainment
News
News
Programming
Programming
Security
Security
Science
Science
Design
Design
Environment
Environment
Finance
Finance
Crypto
Crypto
Politics
Politics
Sports
Sports
Education
Education
Gaming
Gaming
Art
Art
Music
Music
Health
Health
Books
Books
Food
Food
Travel
Travel
Personal
Personal
Bluesky
Twitter

KV - Read multiple keys from Workers KV with bulk reads

1y ago

Source

CloudflareKV - Read multiple keys from Workers KV with bulk readscloudflare.com
Snippet from the RSS feed
You can now retrieve up to 100 keys in a single bulk read request made to Workers KV using the binding. This makes it easier to request multiple KV pairs within a single Worker invocation. Retrieving many key-value pairs using the bulk read operation is more performant than making individual requests since bulk read operations are not affected by Workers simultaneous connection limits . // Read single key const key = "key-a" ; const value = await env . NAMESPACE . get ( key ) ; // Read multiple keys const keys = [ "key-a" , "key-b" , "key-c" , ... ] // up to 100 keys const values : Map < string , string ? > = await env . NAMESPACE . get ( keys ) ; // Print the value of "key-a" to the console. console . log ( `The first key is ${ values . get ( "key-a" ) } .` ) Consult the Workers KV Read key-value pairs API for full details on Workers KV's new bulk reads support.

You might also wanna read

Comments

Sign in to join the conversation.

No comments yet. Be the first.