diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-03-27 15:01:54 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-03-27 15:01:54 +0000 |
| commit | ab0c4b49e2f6d73df4ebfceb2037f1cd29edb3d6 (patch) | |
| tree | 0cb6138bdbc263b390b03a9e08df59f6f3c24760 | |
| parent | 5c28a95722cb748521199afe3200b66fa6a72b68 (diff) | |
Clarify multiple_output usage
| -rw-r--r-- | README.md | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -32,14 +32,15 @@ irrespective of the value of `multiple_output`: jq(".[]").transform("[1, 2, 3]", text_output=True) == "1\n2\n3" ``` -The `multiple_output` argument can be used for cases when multiple output elements are expected: +If `multiple_output` is `False` (the default), then the first output is used: ```python -jq(".[]+1").transform([1, 2, 3], multiple_output=True) == [2, 3, 4] +jq(".[]+1").transform([1, 2, 3]) == 2 ``` -If there are multiple output elements, but `multiple_output` is not set to `True`, then the first output is used: +If `multiple_output` is `True`, +all output elements are returned in an array: ```python -jq(".[]+1").transform([1, 2, 3]) == 2 +jq(".[]+1").transform([1, 2, 3], multiple_output=True) == [2, 3, 4] ``` |
