Skip to content

Commit

Permalink
doc: document missing filter operators
Browse files Browse the repository at this point in the history
  • Loading branch information
ptitFicus committed Jul 18, 2023
1 parent 993f9d5 commit 2490bb5
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions manual/src/main/paradox/_template/js/expression-language.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,23 @@ document.addEventListener("DOMContentLoaded", function () {
{ expression: '{ "<key>": { "$gte": <number> } }', description: "a field with number value greater or equal to number" },
{ expression: '{ "<key>": { "$lt": <number> } }', description: "a field with number value lower than number" },
{ expression: '{ "<key>": { "$lte": <number> } }', description: "a field with number value lower or equal to number" },
{ expression: '{ "<key>": { "$between": { "min": <number>, "max": <number> } } }', description: "a field with value between two values" },
{ expression: '{ "<key>": { "$between": { "min": <number>, "max": <number> } } }', description: "a field with value between two values (exclusive)" },
{ expression: '{ "<key>": { "$betweene": { "min": <number>, "max": <number> } } }', description: "a field with value between two values (inclusive)" },
{ expression: '{ "<key>": { "$and": [ { "<key2>": "<value>" }, { "<key3>" : "<value>" }] } }', description: "an object with two fields with values" },
{ expression: '{ "<key>": { "$or": [ { "<key2>": "<value>" }, { "<key3>" : "<value>" }] } }', description: "an object with one subfield matching an element of the list" },
{ expression: '{ "$or": [ { "<key2>": "<value>" }, { "<key3>" : "<value>" }] }', description: "an object matching at least one condition of the list" },
{ expression: '{ "$nor": [ { "<key2>": "<value>" }, { "<key3>" : "<value>" }] }', description: "an object that matches no conditions of the list" },
{ expression: '{ "<key>": ["<value>", "<value2>"] }', description: "an array field with values" },
{ expression: '{ "<key>": { "$contains": "<value>" } }', description: "an array field containing a specific value" },
{ expression: '{ "<key>": { "$all": ["<value>", "<value>"] } }', description: "and array field containing all specific values" }
{ expression: '{ "<key>": { "$contains": { "key": "<subkey>", "value": <value> } } }', description: "an object containing a key subkey with given value" },
{ expression: '{ "<key>": { "$all": ["<value>", "<value>"] } }', description: "and array field containing all specific values" },
{ expression: '{ "<key>": { "$regex": "<value>" } }', description: "a string field whose value match given regular expression" },
{ expression: '{ "<key>": { "$in": [<value>, <value2>] } }', description: "a field containing one of the given value" },
{ expression: '{ "<key>": { "$nin": [<value>, <value2>] } }', description: "a field containing none of the given value" },
{ expression: '{ "<key>": { "$size": <number> } }', description: "an array field whose size is given value" },
{ expression: '{ "<key>": { "$not": <condition> } }', description: "an object that does not satisfy condition" },
{ expression: '{ "<key>": { "$eq": <value> } }', description: "a field key with value" },
{ expression: '{ "<key>": { "$ne": <value> } }', description: "a field key whose value is not provided value" },
{ expression: '{ "<key>": { "$exists": "<entry>" } }', description: "an object field containing given entry as key" }
],
values: [
{ expression: '{ "foo": "bar" }', description: "Keep events with foo as key and bar as value" },
Expand All @@ -294,12 +305,23 @@ document.addEventListener("DOMContentLoaded", function () {
{ expression: '{ "status": { "$gte": 100 } }', description: "Keep events with status code greater or equal to 100" },
{ expression: '{ "status": { "$lt": 100 } }', description: "Keep events with status code lower than 100" },
{ expression: '{ "status": { "$lte": 100 } }', description: "Keep events with status code lower or equal to 100" },
{ expression: '{ "status": { "$between": { "min": 100, "max": 200 } } }', description: "Keep events with status code between 100 and 200" },
{ expression: '{ "status": { "$between": { "min": 100, "max": 200 } } }', description: "Keep events with status code between 100 and 200 (100 and 200 won't match)" },
{ expression: '{ "status": { "$betweene": { "min": 100, "max": 200 } } }', description: "Keep events with status code between 100 and 200 (100 and 200 will match)" },
{ expression: '{ "inner": { "$and": [ { "foo": "bar" }, { "bar" : "foo" }] } }', description: "Keep events matching the list of key-value" },
{ expression: '{ "inner": { "$or": [ { "foo": "bar" }, { "bar" : "foo" }] } }', description: "Keep events matching one condition of the list of key-value" },
{ expression: '{ "$or": [ { "method": "DELETE" }, { "protocol" : "http" }] }', description: "Keep event whose method is http OR method is DELETE OR both" },
{ expression: '{ "$nor": [ { "method": "DELETE" }, { "protocol" : "http" }] }', description: "Keep events whose method is not DELETE AND protocol is not http" },
{ expression: '{ "codes": ["a", "b"] }', description: "Keep events with an array codes which strictly containing values a and b" },
{ expression: '{ "codes": { "contains": "a" } }', description: "Keep events with an array codes containing an a value" },
{ expression: '{ "codes": { "$all": ["a", "b"] } }', description: "Keep events with an array codes containing at minima a and b values" }
{ expression: '{ "codes": { "$contains": "a" } }', description: "Keep events with an array codes containing an a value" },
{ expression: '{ "target": { "$contains": { "key": "scheme", "value": "https" } } }', description: "Keep events whose target contains a field 'scheme' valued to 'https' " },
{ expression: '{ "codes": { "$all": ["a", "b"] } }', description: "Keep events with an array codes containing at minima a and b values" },
{ expression: '{ "url": { "$regex": ".*api.*" } }', description: "Keep events with url containing 'api'" },
{ expression: '{ "method": { "$in": ["PUT", "POST"] } }', description: "Keep events whose method is PUT or POST" },
{ expression: '{ "method": { "$nin": ["PUT", "POST"] } }', description: "Keep events whose method is neither PUT nor POST" },
{ expression: '{ "headers": { "$size": 12 } }', description: "Keep events with exactly 12 headers" },
{ expression: '{ "url": { "$not": { "$regex": ".*api.*" } } }', description: "Keep events whose url does not contain 'api'" },
{ expression: '{ "foo": { "$eq": "bar" } }', description: "Keep events with foo as key and bar as value" },
{ expression: '{ "foo": { "$ne": "bar" } }', description: "Keep events with foo field not equal to bar" },
{ expression: '{ "target": { "$exists": "scheme" } }', description: "Keep events whose target object contains a schema field" }
]
}
]
Expand Down

0 comments on commit 2490bb5

Please sign in to comment.