Carrot reference
Operators
an operator in carrot is one or more symbols or words that compare the value of a field on its left with one or more values (or functions) on its right the valuation of the clause will always result as true carrot operators understand money math and automatically convert currencies when adding or subtracting two different currencies operator list name function https //docs charthop com/add an operator used to add two or more expressions https //docs charthop com/ subtract an operator used to subtract an expression from another expression https //docs charthop com/multiply an operator used to multiply two or more expressions https //docs charthop com/divide an operator used to divide one expression by another https //docs charthop com/percent modulus an operator used to calculate the remainder of a division operation https //docs charthop com/ equals returns true when the value of a given field and a given expression are the same https //docs charthop com/ not equals returns all records where the value of a given field and a given expression are not the same https //docs charthop com/not invalidates the truthiness of an evaluated expression https //docs charthop com/greater greater than returns all records where the value of one expression or field is greater than the value of another expression or field https //docs charthop com/greater greater than equals returns all records where the value of one expression or field is greater than or equal to the value of another expression or field https //docs charthop com/less less than returns all records where the value of one expression or field is less than the value of another expression or field https //docs charthop com/less less than equals returns all records where the value of one expression or field is less than or equal to the value of another expression or field https //docs charthop com/ array access a given expression as an array, and return a defined position on that array https //docs charthop com/match returns true where the value of a given field and a given expression partially match https //docs charthop com/andand and a logic operator used to evaluate the truthiness of two or more expressions a logic operator used to evaluate the truthiness of at least one expression in a sequence of expressions https //docs charthop com/if a logic operator used to return a defined expression based on the truthiness of one or more other expressions evaluates the truthiness of an expression, and returns the value of one of two expressions based on that outcome https //docs charthop com/elvis evaluates the truthiness of the first expression, and returns its value if that value is truthy if the value of the first expression is not truthy, it returns the value of the second expression https //docs charthop com/dot used to retrieve a property of a given field operator precedence when an expression makes use of more than one operator, carrot relies on a set of rules to determine the order in which each operator is evaluated carrot follows a standard order of operations when evaluating an expression based on operator precedence operators that have a higher precedence in the table below will be evaluated first precedence operator associativity 9 docid\ py8skx3 aqulsnusbcd5r docid\ t8hbpytpsanh8yfiz4yjf left to right 8 docid\ hdagli50afseam4jx6b8n right to left 7 docid\ bnpkfaw9igsz2hpk4wxbh docid\ lujcyamvfnapfnvx916 k docid 0fwsqipglrw4xsav7bypk left to right 6 docid\ dslknikexseseztv3c5zv docid\ x9joqmwhvhtajogmjlbua left to right 5 docid\ dfzeov4u zpslrwr83bl docid\ ibs4w l1pwa6xmswyvujq docid\ kc0htlkxuvbamz x6qft9 docid\ ye9gwbz itgpxtbdzxd a not associative 4 docid\ ldpinc46sdru3oqyn7cb2 docid 50o8vwta5zp6sv8dqdwjl docid\ g6prxutgm2vrcnw7hcqry left to right 3 docid\ uvpxllwgcpzrpr42e2nxm left to right 2 docid\ a7wcsbxwsjewfyjwbuh8z left to right 1 docid\ mjphsjn60dsm44oo2welj docid\ x hm1bldw8awd8 byrlzv right to left consider the expression below variablea variableb + variablec without operator precedence, carrot would not know which operation to complete first if we refer to the table above, we see that multiplication has a higher precedence than addition thus, variablea variableb is evaluated first, then the result of that expression is added to variablec of course, addition and multiplication are two well known examples of operator precedence in arithmetic, and it works in the same way in carrot just like arithmetic, if you wanted to change the precedence of the above expression, you would use parenthesis as illustrated below variablea (variableb + variablec) in the above expression, we are telling carrot to explicitly add variableb to variablec before multiplying the result by variablea
