Elektra  0.8.26
Plugin: yamlsmith

YAML Smith

Examples

Scalar

# Save a single key-value pair
kdb set user/tests/yamlsmith 'Pattern Against User'
# Only export the value
kdb export user/tests/yamlsmith yamlsmith
#> "Pattern Against User"
# Undo modifications
kdb rm -r user/tests/yamlsmith

Mappings

# Add some key-value pairs to the database
kdb set user/tests/yamlsmith/key value
kdb set user/tests/yamlsmith/time 'will die and love will burrow it'
kdb set user/tests/yamlsmith/level1/one 'I'
kdb set user/tests/yamlsmith/level1/two 'II'
# Export data using YAML Smith
kdb export user/tests/yamlsmith yamlsmith
#> key:
#> "value"
#> level1:
#> one:
#> "I"
#> two:
#> "II"
#> time:
#> "will die and love will burrow it"
# Undo modifications
kdb rm -r user/tests/yamlsmith

Arrays

kdb set user/tests/yamlsmith/low
kdb set user/tests/yamlsmith/low/#0 'You bought some sweet, sweet, sweet, sweet sunflowers'
kdb set user/tests/yamlsmith/low/#1 'And gave them'
kdb set user/tests/yamlsmith/low/#2 'To the night'
kdb export user/tests/yamlsmith yamlsmith
#> low:
#> -
#> "You bought some sweet, sweet, sweet, sweet sunflowers"
#> -
#> "And gave them"
#> -
#> "To the night"
# Undo modifications
kdb rm -r user/tests/yamlsmith

Limitations