Skip to content

Operators Reference

FlexQuery.NET provides a comprehensive set of operators for filtering data. These operators behave consistently across all query formats.

Comparison Operators

Standard numeric and date comparisons.

OperatorDescriptionDSL/JSON ExampleJQL Example
eqEqualage:eq:25age = 25
neqNot equalstatus:neq:Closedstatus != "Closed"
gtGreater thanprice:gt:100price > 100
gteGreater than or equalprice:gte:100price >= 100
ltLess thanrating:lt:5rating < 5
lteLess than or equalrating:lte:5rating <= 5

String Operators

Powerful substring and pattern matching for text fields.

OperatorDescriptionDSL/JSON ExampleJQL Example
containsSubstring searchname:contains:johnname CONTAINS "john"
startswithPrefix searchsku:startswith:ABCsku STARTSWITH "ABC"
endswithSuffix searchemail:endswith:.comemail ENDSWITH ".com"
likeSQL LIKE patternname:like:%smith%name LIKE "%smith%"

Null Check Operators

Explicit checks for presence or absence of data.

OperatorDescriptionDSL/JSON ExampleJQL Example
isnullIs nulldeletedAt:isnulldeletedAt IS NULL
isnotnullIs not nullupdatedAt:isnotnullupdatedAt IS NOT NULL

Collection & Range Operators

Filtering based on sets or ranges of values.

OperatorDescriptionDSL/JSON ExampleJQL Example
inValue in liststatus:in:Active,Pendingstatus IN ("Active", "Pending")
notinValue not in listcategory:notin:Oldcategory NOT IN ("Old")
betweenInclusive rangeprice:between:10,50price BETWEEN 10 AND 50

Advanced (Collection) Operators

Scoped filtering for nested navigation properties.

OperatorDescriptionExample
anyAt least one matchorders:any:total:gt:100
allAll elements matchitems:all:status:eq:Shipped
countCount comparisonorders:count:gt:5

Logic & Negation

FlexQuery supports complex logical combinations and negation.

  • Negation (!, not):
    • DSL: !name:eq:john or not(name:eq:john)
    • JQL: NOT name = "john"
  • Logical AND/OR:
    • DSL: & (AND), | (OR)
    • JQL: AND, OR
    • JSON: "logic": "and", "logic": "or"

Operator Normalization

FlexQuery is syntax-tolerant and automatically normalizes common variants to their canonical codes during parsing.

Your InputNormalized To
=, ==, equalseq
!=, notequalneq
>, greaterthangt
>=, gegte
<, lessthanlt
<=, lelte

Usage Examples

Here are some common ways to use these operators in a standard query string:

  • Age over 25: ?filter=age:gt:25
  • Name search: ?filter=name:contains:john
  • Multiple statuses: ?filter=status:in:Active,Pending
  • Price range: ?filter=price:between:100,500

Strongly-Typed Usage

When building queries in C#, use the FilterOperators constants to ensure consistency.

csharp
using FlexQuery.NET.Constants;

var condition = new FilterCondition 
{ 
    Field = "Status", 
    Operator = FilterOperators.Equal, 
    Value = "Active" 
};

Formatting Tips

  • Dates: Use ISO-8601 strings (e.g., 2026-05-01T10:00:00Z).
  • Enums: Use the string representation or the integer value.
  • Nulls: Use the isnull or notnull operators instead of comparing to a "null" string.

Released under the MIT License.