Skip to content

KV get() and getWithMetadata() parameters are wrong #18226

@GregBrimble

Description

@GregBrimble

Existing documentation URL(s)

https://developers.cloudflare.com/kv/api/read-key-value-pairs/

What changes are you suggesting?

env.NAMESPACE.get(key: string, type?: string, options?: { cacheTtl: number; type: string });

is wrong. It's actually:

env.NAMESPACE.get(key: string, options?: string | { cacheTtl?: number; type?: string });

https://github.com/cloudflare/workerd/blob/a8c1bf917d59128c3ba680faa1fb44a05c9c5a20/src/workerd/api/kv.c%2B%2B#L108

Similarly, it should be:

env.NAMESPACE.getWithMetadata(key: string, options?: string | { cacheTtl?: number; type?: string });

https://github.com/cloudflare/workerd/blob/a8c1bf917d59128c3ba680faa1fb44a05c9c5a20/src/workerd/api/kv.c%2B%2B#L119

Additional information

I haven't checked any other pages. Might also be mistakes there. Worth considering some dynamic gen here too, like the Wrangler commands? cc. @KianNH

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions