Commit cbde8e57 authored by Tobias Schmidt's avatar Tobias Schmidt

Merge pull request #373 from prometheus/document-unless

Document complement set operator "unless"
parents 1cd80c7d c98c79c7
...@@ -78,6 +78,7 @@ These logical/set binary operators are only defined between instant vectors: ...@@ -78,6 +78,7 @@ These logical/set binary operators are only defined between instant vectors:
* `and` (intersection) * `and` (intersection)
* `or` (union) * `or` (union)
* `unless` (complement)
`vector1 and vector2` results in a vector consisting of the elements of `vector1 and vector2` results in a vector consisting of the elements of
`vector1` for which there are elements in `vector2` with exactly matching `vector1` for which there are elements in `vector2` with exactly matching
...@@ -88,6 +89,10 @@ over from the left-hand-side vector. ...@@ -88,6 +89,10 @@ over from the left-hand-side vector.
(label sets + values) of `vector1` and additionally all elements of `vector2` (label sets + values) of `vector1` and additionally all elements of `vector2`
which do not have matching label sets in `vector1`. which do not have matching label sets in `vector1`.
`vector1 unless vector2` results in a vector consisting of the elements of
`vector1` for which there are no elements in `vector2` with exactly matching
label sets. All matching elements in both vectors are dropped.
## Vector matching ## Vector matching
Operations between vectors attempt to find a matching element in the right-hand-side Operations between vectors attempt to find a matching element in the right-hand-side
...@@ -211,8 +216,8 @@ highest to lowest. ...@@ -211,8 +216,8 @@ highest to lowest.
1. `*`, `/`, `%` 1. `*`, `/`, `%`
2. `+`, `-` 2. `+`, `-`
3. `==`, `!=`, `<=`, `<`, `>=`, `>` 3. `==`, `!=`, `<=`, `<`, `>=`, `>`
4. `AND` 4. `and`, `unless`
5. `OR` 5. `or`
Operators on the same precedence level are left-associative. For example, Operators on the same precedence level are left-associative. For example,
`2 * 3 % 2` is equivalent to `(2 * 3) % 2`. `2 * 3 % 2` is equivalent to `(2 * 3) % 2`.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment