Skip to main content

Overview

Special operators provide range checking and null validation capabilities:

between

Check if value is within range

isNull

Check if value is null/undefined

isNotNull

Check if value exists

Architecture

Source: src/operators/special.js | Tests: tests/unit/operators/special.test.js

between - Range Check

Check if a value is within a range (inclusive).

Syntax

Parameters

number
required
Value to check - field path or literal
[number, number]
required
Range as [min, max] array - literal or field path

Returns

boolean - true if min ≤ value ≤ max, false otherwise

Examples

Notes

Inclusive: Both min and max are included. between: [10, 20] matches 10, 15, and 20.
Alternative: You can use { and: [{ gte: [value, min] }, { lte: [value, max] }] } for the same effect.

isNull - Null Check

Check if a value is null or undefined.

Syntax

Parameters

string
required
Field path to check

Returns

boolean - true if value is null, undefined, or field doesn’t exist

Examples

isNotNull - Not Null Check

Check if a value exists (not null or undefined).

Syntax

Parameters

string
required
Field path to check

Returns

boolean - true if value exists and is not null or undefined

Examples

Notes

Inverse: isNotNull is equivalent to { not: [{ isNull: [field] }] }

Common Patterns

Error Handling

Quick Reference

Numeric

gt, gte, lt, lte

Comparison

eq, neq

Logical

and, or, not

Array

in, notIn

String

contains, startsWith

All Operators

Complete reference

API Reference