summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authormeehawk <80167324+meehawk@users.noreply.github.com>2021-05-17 19:15:33 +0530
committerGitHub <noreply@github.com>2021-05-17 15:45:33 +0200
commitabbc99d4c60b102e2779e4362ceb433095719384 (patch)
treef567d55d5ba900a488d777cb5fb979f414d2e061 /docs
parent76c95f55a5d18290baa7f23667161d4af9fb9b53 (diff)
common/maps: Add Scratch.DeleteInMap
Add Scratch.DeleteInMap method. This method works similar to Scratch.SetInMap. It takes in two string parameters, key and mapKey and deletes the value mapped to mapKey in key Closes #8504
Diffstat (limited to 'docs')
-rw-r--r--docs/content/en/functions/scratch.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/content/en/functions/scratch.md b/docs/content/en/functions/scratch.md
index 10623b2cb..f42b0ad57 100644
--- a/docs/content/en/functions/scratch.md
+++ b/docs/content/en/functions/scratch.md
@@ -97,6 +97,18 @@ Takes a `key`, `mapKey` and `value` and add a map of `mapKey` and `value` to the
{{ .Scratch.Get "greetings" }} > map[french:Bonjour english:Hello]
```
+#### .DeleteInMap
+Takes a `key` and `mapKey` and removes the map of `mapKey` from the given `key`.
+
+```go-html-template
+{{ .Scratch.SetInMap "greetings" "english" "Hello" }}
+{{ .Scratch.SetInMap "greetings" "french" "Bonjour" }}
+----
+{{ .Scratch.DeleteInMap "greetings" "english" }}
+----
+{{ .Scratch.Get "greetings" }} > map[french:Bonjour]
+```
+
#### .GetSortedMapValues
Returns array of values from `key` sorted by `mapKey`