LT() and GT() allow you to compare different data types, but are compared using the type precedence.
Types have an order of precedence. When comparing values of different types, they are ranked in the following order, from least to greatest.
1 Number (integers and decimals: 0.5 < 1 < 1.5 < 2)
2 Byte
3 String
4 Array (ordered lexically, like strings)
5 Object (ordered lexically, like strings)
6 Ref
7 Timestamp
8 Date
9 Boolean (false < true)
10 Null
@Luigi_Servini, thank you for reply, i haven’t seen that part of doc - its not a priority but maybe docs for GT etc could be updated to point to this precedence.