# Comparison Component

### You can see the comparison component in:

* Scenario steps
  * Condition step
  * Search step
* Settings of scheduled scenario start
* Filters, Security Layers in API endpoint settings
* Filters and post-filters in Report settings

{% hint style="info" %}
Note that there is also a [data-type](https://readme.directual.com/data/data-types)—operator;
{% endhint %}

Here is a standard Directual comparison component:

![](https://3071851461-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4Nnmtk9_gFGWOddsf6%2F-M6iQUcFouVhvkLl-bKg%2F-M6iWxRd26XUIDKBbZfC%2Ffilter.png?alt=media\&token=ab35e60b-8898-40e0-bd9b-aa69edab604e)

### The list of operators

There are following operators (lets compare **A** and **B**):

| Operator                       | Description                                                                                                                                                                                                                                                               | Example                                                                                                                                                                            |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **>, <, >=, <=, ==, !=**       | <p>Standard operators: more; less; more or equal; less or equal; equal; not equal.</p><p>Compares different data types.</p>                                                                                                                                               | <p><code>A > B</code></p><p><code>// true for A=5, B = 3;</code></p><p></p><p><code>A == B</code></p><p><code>// true for A = 5, B = '5' (A is number, B is string type</code></p> |
| **in**                         | **B** is an array and contains **A**                                                                                                                                                                                                                                      | <p><code>A in B</code></p><p><code>// true for A = 1, B = 2,3,1,5</code></p>                                                                                                       |
| **equalsDate, equalsDateTime** | <p><strong>A</strong> is date, <strong>B</strong> may be string, operator convert it to a date in <code>YYYY-MM-DDTHH:mm:SS+Z</code> format.</p><p><code>equalsDate</code> compares year+month+date. </p><p><code>equalsDateTime</code> requires the full conformity.</p> | <p><code>A equalsDate B</code></p><p><code>// true for A = 2020-04-01T12:00, B = 2020-04-21T21:10</code></p>                                                                       |
| **like**                       | <p>String <strong>B</strong> contains string <strong>A</strong>, not paying attention to lower case / upper case.</p><p>Acts as a lightweight <code>RegExp</code></p>                                                                                                     | <p><code>A like B</code></p><p><code>// true for A = 'hello', B = 'Mike developed: Hello, world!'</code> </p>                                                                      |
| **regExp**                     | Regular expression, or `regExp` is a sequence of characters that define a search pattern.                                                                                                                                                                                 | Explore details and examples in [RegExp article](https://readme.directual.com/template-system/comparison-operators/regular-expressions)                                            |
| **isNotNull**                  | Compares **A** and **NULL** (empty field)                                                                                                                                                                                                                                 | <p><code>A isNotNull</code></p><p><code>// false for A = '', true for A = 'hello'</code></p>                                                                                       |
| **isEmpty**                    | Checks if **A** is empty                                                                                                                                                                                                                                                  | <p><code>A isEmpty</code></p><p><code>// false for A = 'hello', true for A = ''</code></p>                                                                                         |
| **arrayContainsAny**           | **A** id an Array and **B** is an array. `arrayContainsAny`means that we can find at least one element of **B** among elements of **A**                                                                                                                                   | <p><code>A arrayContainsAny B</code></p><p><code>// true for A = 1,2,3 and B = 4,3,0,a (3 is a common element)</code></p>                                                          |
| **arrayContainsAll**           | **A** id an Array and **B** is an array. `arrayContainsAll`means that we can find all the elements of **B** among elements of **A**                                                                                                                                       | <p><code>A arrayContainsAny B</code></p><p><code>// true for A = 1,2,3 and B = 2,3</code></p><p><code>// false for A = 1,2,3 and B = 2,0</code></p>                                |
