fix kv set examples (#15769)

As talked in #15588, I have updated the examples of `kv set` so that it
correctly shows how to use the command with closures.
This commit is contained in:
Tyarel8 2025-05-18 05:31:46 +02:00 committed by GitHub
parent 457f162fd9
commit 5483519c7d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,8 +21,13 @@
@example "Store a number" {
kv set foo 5
}
@example "Update a number" {
kv set foo { $in + 1 }
@example "Update a number and return it" {
let $new_foo = (kv get foo | kv set foo { $in + 1 } --return value)
}
@example "Use a single pipeline with closures" {
ls
| kv set names { get name }
| kv set sizes { get size }
}
export def "kv set" [
key: string