Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.moss.dev/llms.txt

Use this file to discover all available pages before exploring further.

@moss-dev/moss / FilterCondition

Type Alias: FilterCondition

A single condition evaluated against one metadata field inside a MetadataFilter.
type FilterCondition =
  | { $eq:  string | number }
  | { $ne:  string | number }
  | { $gt:  string | number }
  | { $gte: string | number }
  | { $lt:  string | number }
  | { $lte: string | number }
  | { $in:  (string | number)[] }
  | { $nin: (string | number)[] }
  | { $near: string };

Operators

OperatorDescription
$eqField is equal to the given value.
$neField is not equal to the given value.
$gtField is strictly greater than the value.
$gteField is greater than or equal to the value.
$ltField is strictly less than the value.
$lteField is less than or equal to the value.
$inField matches any value in the array.
$ninField does not match any value in the array.
$nearGeo-proximity match against the field (accepts an encoded location string).

Example

// Documents whose `price` is between 50 and 100
{ field: 'price', condition: { $gte: 50 } }
{ field: 'price', condition: { $lt: 100 } }