> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metrics-man.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Operators

# MMQL Operators

This section provides detailed information about all the MMQL operators, organized by category.

## Operator Categories

MMQL operators are organized into the following categories:

### [Logical Operators](/mmql/operators/logical/and)

* `$and` - Logical AND operation
* `$or` - Logical OR operation
* `$not` - Logical NOT operation
* `$nor` - Logical NOR operation
* `$nand` - Logical NAND operation

### [Comparison Operators](/mmql/operators/comparison/eq)

* `$eq` - Equal to
* `$ne` - Not equal to
* `$gt` - Greater than
* `$gte` - Greater than or equal to
* `$lt` - Less than
* `$lte` - Less than or equal to
* `$cmp` - Compare values (returns -1, 0, or 1)

### [Arithmetic Operators](/mmql/operators/arithmetic/add)

* `$add` - Addition
* `$subtract` - Subtraction
* `$multiply` - Multiplication
* `$divide` - Division
* `$mod` - Modulo
* `$min` - Minimum value
* `$max` - Maximum value
* `$abs` - Absolute value
* `$ceil` - Ceiling
* `$exp` - Exponential
* `$floor` - Floor
* `$log` - Logarithm
* `$pow` - Power
* `$round` - Round
* `$sqrt` - Square root
* `$trunc` - Truncate

### [Aggregation Operators](/mmql/operators/aggregation/sum)

* `$sum` - Sum of all values
* `$avg` - Average of all values
* `$median` - Median of all values

### [Bitwise Operators](/mmql/operators/bitwise/bitand)

* `$bitAnd` - Bitwise AND
* `$bitOr` - Bitwise OR
* `$bitXor` - Bitwise XOR
* `$bitNot` - Bitwise NOT
* `$bitLeftShift` - Bitwise left shift
* `$bitRightShift` - Bitwise right shift

### [String Operators](/mmql/operators/string/contains)

* `$contains` - Contains substring
* `$startsWith` - Starts with substring
* `$endsWith` - Ends with substring
* `$regex` - Match regular expression
* `$toUpper` - Convert to uppercase
* `$toLower` - Convert to lowercase
* `$concat` - Concatenate strings
* `$trim` - Trim characters
* `$split` - Split string
* `$replace` - Replace substring
* `$replaceAll` - Replace all substrings
* `$length` - String length
* `$parseToString` - Parse to string
* `$toString` - Convert to string with formatting
* `$camelCase` - Convert to camelCase
* `$snakeCase` - Convert to snake\_case
* `$kebabCase` - Convert to kebab-case
* `$titleCase` - Convert to Title Case
* `$wordCount` - Count words
* `$lineCount` - Count lines

### [Time/Date Operators](/mmql/operators/time-date/todate)

* `$toDate` - Parse string to date
* `$toTimestamp` - Convert to timestamp
* `$year` - Extract year
* `$month` - Extract month
* `$day` - Extract day
* `$hour` - Extract hour
* `$minute` - Extract minute
* `$second` - Extract second
* `$dayOfWeek` - Extract day of week
* `$dayOfYear` - Extract day of year
* `$weekOfYear` - Extract week of year
* `$quarter` - Extract quarter
* `$addDays` - Add days to date
* `$addMonths` - Add months to date
* `$addYears` - Add years to date
* `$addHours` - Add hours to date
* `$addMinutes` - Add minutes to date
* `$addSeconds` - Add seconds to date
* `$dateDiff` - Calculate date difference

### [Array Operators](/mmql/operators/array/first)

* `$first` - Get first element
* `$last` - Get last element
* `$nth` - Get nth element
* `$filter` - Filter array elements
* `$map` - Transform array elements
* `$reduce` - Reduce array to single value
* `$find` - Find first matching element
* `$every` - Check if all elements match condition
* `$some` - Check if any elements match condition

### [Object Operators](/mmql/operators/object/keys)

* `$keys` - Get object keys
* `$values` - Get object values
* `$hasKey` - Check if object has key

### [Value Checking Operators](/mmql/operators/value-checking/isnull)

* `$isNull` - Check if value is null
* `$isEmpty` - Check if value is empty

### [Type Conversion Operators](/mmql/operators/type-conversion/toboolean)

* `$toBoolean` - Convert to boolean
* `$toNumber` - Convert to number
* `$toString` - Convert to string

### [Conditional Operators](/mmql/operators/conditional/ifelse)

* `$ifelse` - Conditional expression

### [Random Operator](/mmql/operators/random/random)

* `$random` - Generate random number

### [Math Operators](/mmql/operators/math/clamp)

* `$clamp` - Clamp value within bounds

### [UUID and Hash Operators](/mmql/operators/uuid-hash/uuid)

* `$uuid` - Generate UUID
* `$hash` - Compute hash

### [Constant Operators](/mmql/operators/constants/true)

* `$true` - Returns true value
* `$false` - Returns false value
* `$null` - Returns null value
* `$void` - Returns void value

### [Block Operators](/mmql/operators/blocks/block)

* `$block` - Execute block of expressions
* `$let` - Declare variable
* `$var` - Get variable value
* `$return` - Return value from block

### [Input Operator](/mmql/operators/input/input)

* `$input` - Access field in input data
