Skip to content

Commit

Permalink
Add reject filter docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ogonkov committed Apr 2, 2020
1 parent 1a064c3 commit 0b1e9dc
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/templating.md
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,32 @@ Select a random value from an array.

A random value between 1-9 (inclusive).

### reject

Filters a sequence of objects by applying a test to each object, and rejecting
the objects with the test succeeding.

If no test is specified, each object will be evaluated as a boolean.

**Input**

```jinja
{% set numbers=[0, 1, 2, 3, 4, 5] %}
{{ numbers | reject("odd") | join }}
{{ numbers | reject("even") | join }}
{{ numbers | reject("divisibleby", 3) | join }}
{{ numbers | reject() | join }}
```

**Output**

```jinja
024
135
1245
0
```

### rejectattr (only the single-argument form)

Expand Down

0 comments on commit 0b1e9dc

Please sign in to comment.