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 + (add) an operator used to add two or more expressions (subtract) an operator used to subtract an expression from another expression (multiply) an operator used to multiply two or more expressions / (divide) an operator used to divide one expression by another % (modulus) an operator used to calculate the remainder of a division operation = (equals) returns true when the value of a given field and a given expression are the same != (not equals) returns all records where the value of a given field and a given expression are not the same ! (not) invalidates the truthiness of an evaluated expression > (greater than) returns all records where the value of one expression or field is greater than the value of another expression or field >= (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 < (less than) returns all records where the value of one expression or field is less than the value of another expression or field <= (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 \[ ]\(array) access a given expression as an array, and return a defined position on that array (match) returns true where the value of a given field and a given expression partially match && (and) a logic operator used to evaluate the truthiness of two or more expressions || (or) a logic operator used to evaluate the truthiness of at least one expression in a sequence of expressions if a logic operator used to return a defined expression based on the truthiness of one or more other expressions ? (ternary) evaluates the truthiness of an expression, and returns the value of one of two expressions based on that outcome ? (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 (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 \[ ]\(array) docid\ py8skx3 aqulsnusbcd5r (dot) docid\ t8hbpytpsanh8yfiz4yjf left to right 8 ! (not) docid\ hdagli50afseam4jx6b8n right to left 7 (multiply) docid\ bnpkfaw9igsz2hpk4wxbh / (divide) docid\ lujcyamvfnapfnvx916 k % (modulus) docid 0fwsqipglrw4xsav7bypk left to right 6 + (add) docid\ dslknikexseseztv3c5zv (subtract) docid\ x9joqmwhvhtajogmjlbua left to right 5 < (less than) docid\ dfzeov4u zpslrwr83bl <= (less than equals) docid\ ibs4w l1pwa6xmswyvujq > (greater than) docid\ kc0htlkxuvbamz x6qft9 >= (greater than equals) docid\ ye9gwbz itgpxtbdzxd a not associative 4 (match) docid\ ldpinc46sdru3oqyn7cb2 = (equals) docid 50o8vwta5zp6sv8dqdwjl != (not equals) docid\ g6prxutgm2vrcnw7hcqry left to right 3 && (and) docid\ uvpxllwgcpzrpr42e2nxm left to right 2 || (or) docid\ a7wcsbxwsjewfyjwbuh8z left to right 1 ? (ternary) docid\ mjphsjn60dsm44oo2welj ? (elvis) 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