Skip to content

Expressions Overview

quyvu edited this page Oct 14, 2026 · 3 revisions

FxMap Expression Language

A powerful expression language for flexible data querying and transformation. Navigate objects, filter collections, aggregate data, and more.

Expression Capabilities

Property AccessName, Country?.Province?.City

FiltersOrders:where(Status = 'Done' && Total > 100)

Sorting & PagingOrders:orderBy(Total desc):limit(10)

FunctionsName:upper, Price:round(2), CreatedAt:year

AggregationsOrders:count, Orders:sum(Total), Orders:avg(Price)

Projections{Id, Name, Country.Name as Location}

Coalesce & TernaryNickname ?? Name, Status = 'Active' ? 'Yes' : 'No'

GroupByOrders:groupBy(Status).{Status, :count as Count}

Boolean FunctionsOrders:any, Orders:any(Status = 'Done'), Items:all(Qty > 0)

Quick Reference

# Property Access
Name                                    # Simple
Country?.Name                           # Null-safe
Country.Province.City                   # Nested
 
# Filters
Orders:where(Status = 'Done')                   # Equal
Orders:where(Total > 100 && Status = 'Active')  # Multiple conditions
Orders:where(Status = 'A' || Status = 'B')      # OR condition
 
# Sorting and paging
Orders:orderBy(Date):first                      # First item
Orders:orderBy(Total desc):limit(10)            # Top 10
Orders:orderBy(Date):offset(20):limit(10)       # Page 3 of 10
 
# Functions
Name:upper                              # String function
Price:round(2)                          # Math function
CreatedAt:year                          # Date function
Items:distinct(Category)                # Collection function
 
# Aggregations
Orders:count                            # Count
Orders:sum(Total)                       # Sum
Orders:avg(Price)                       # Average
 
# Boolean Functions
Orders:any                              # Has any
Orders:any(Status = 'Done')             # Any matching
Orders:all(IsValid = true)              # All matching
 
# Projections
{Id, Name, Status}                      # Root projection
Orders.{Id, Total, Customer.Name}       # Collection projection
{Id, Name as FullName}                  # With alias
{(A ?? B) as Value}                     # Computed
 
# Coalesce
Nickname ?? Name ?? 'Unknown'
 
# Ternary
Status = 'Active' ? 'Yes' : 'No'
 
# GroupBy
Orders:groupBy(Status).{Status, :count as Count}
Orders:groupBy(Year, Month).{Year, Month, :sum(Total) as Total}

Notes

Case Sensitivity

  • Keywords: Case-insensitive (groupBy, GROUPBY both work)
  • Property names: Case-sensitive (must match exactly)
  • Functions: Case-insensitive (:upper, :UPPER both work)

Operator Precedence (lowest to highest)

  1. Ternary: ? :
  2. Coalesce: ??
  3. Logical: &&, ||
  4. Comparison: =, !=, >, <
  5. Navigation: .
  6. Projection: .{}
  7. Function: :

Literals

  • String: 'text' or "text"
  • Number: 100, 3.14, -5
  • Boolean: true, false
  • Null: null

Strict Parsing (5.0)

  • The indexer Orders[0 10 asc Date] and the filter Orders(Status = 'Done') are rejected. Use :orderBy, :offset, :limit and :where.
  • Text left after an expression is an error: Name ) throws ExpressionParseException. Before 5.0 it was ignored.
  • See the migration guide.

Filter Comma = AND

  • Comma , in filter equals && (AND)
  • Orders:where(A = 'x', B = 'y') = Orders:where(A = 'x' && B = 'y')

Source: https://fxmapper.net/docs/expressions/ — the website is always the most up to date version.

Clone this wiki locally