Update doc for CEL match for numeric values (#3128)

* Fix CEL match documentation for numeric values

Signed-off-by: Federico Codognotto <fede.codo38@gmail.com>
Signed-off-by: Federico Codognotto <fcodognotto@tempestive.com>

* Update daprdocs/content/en/developing-applications/building-blocks/pubsub/howto-route-messages.md

Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com>
Signed-off-by: Federico Codognotto <62144863+federicocodo@users.noreply.github.com>

---------

Signed-off-by: Federico Codognotto <fede.codo38@gmail.com>
Signed-off-by: Federico Codognotto <fcodognotto@tempestive.com>
Signed-off-by: Federico Codognotto <62144863+federicocodo@users.noreply.github.com>
Co-authored-by: Federico Codognotto <fcodognotto@tempestive.com>
Co-authored-by: Hannah Hunter <94493363+hhunter-ms@users.noreply.github.com>
This commit is contained in:
Federico Codognotto 2023-02-04 02:08:50 +01:00 committed by GitHub
parent 59d36ce91c
commit 75109bf8a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -268,8 +268,11 @@ has(event.data.important) && event.data.important == true
Match deposits greater than $10,000:
```javascript
event.type == "deposit" && event.data.amount > 10000
event.type == "deposit" && int(event.data.amount) > 10000
```
{{% alert title="Note" color="primary" %}}
By default the numeric values are written as double-precision floating-point. There are no automatic arithmetic conversions for numeric values. In this case, if `event.data.amount` is not cast as integer, the match is not performed. For more information, see the [CEL documentation](https://github.com/google/cel-spec/blob/master/doc/langdef.md).
{{% /alert %}}
Match multiple versions of a message: