summaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorStephen Dolan <mu@netsoc.tcd.ie>2012-12-29 16:50:58 +0000
committerStephen Dolan <mu@netsoc.tcd.ie>2012-12-29 16:52:26 +0000
commite0cda536f331b0fc53b493069dce70bb32de9a8b (patch)
tree1b0a0abe8e20417c71f1cd0ce2ac822294eee7cf /docs
parentd5fdf70434a243e6f3bd6967dbc2d28c9144cb29 (diff)
Make null + foo return foo, rather than an error.
This also allows 'add' to be implemented in jq rather than C.
Diffstat (limited to 'docs')
-rw-r--r--docs/content/3.manual/manual.yml9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/content/3.manual/manual.yml b/docs/content/3.manual/manual.yml
index 1de1a387..fba7e4a7 100644
--- a/docs/content/3.manual/manual.yml
+++ b/docs/content/3.manual/manual.yml
@@ -356,6 +356,9 @@ sections:
the key-value pairs from both objects into a single
combined object. If both objects contain a value for the
same key, the object on the right of the `+` wins.
+
+ `null` can be added to any value, and returns the other
+ value unchanged.
examples:
- program: '.a + 1'
@@ -364,6 +367,12 @@ sections:
- program: '.a + .b'
input: '{"a": [1,2], "b": [3,4]}'
output: ['[1,2,3,4]']
+ - program: '.a + null'
+ input: '{"a": 1}'
+ output: ['1']
+ - program: '.a + 1'
+ input: '{}'
+ output: ['1']
- program: '{a: 1} + {b: 2} + {c: 3} + {a: 42}'
input: 'null'
output: ['{"a": 42, "b": 2, "c": 3}']