Querying

Ledge uses a simple composable typed filter.

SearchQuery

{
  "path": "string",
  "search": {}
}
Attribute
Definition

path string

Name of transaction field to apply the query to

search SearchFilter

Search filter to apply, see below.

SearchFilter

The SearchFilter object can be any one of the following:

Text filter

{
  "type": "string",
  "value": "string"|[],
  "exact" : true,
}

Attribute
Definition

type string

One of the following values: string, boolean, number, money, date. For the text filter, this is a constant string.

value string | string[]

The text or texts to search for.

Boolean filter

{
  "type": "boolean",
  "value" : true
}
Attribute
Definition

type string

One of the following values: string, boolean, number, money, date.For the boolean filter, this is a constant boolean.

value boolean

The filter value to apply.

Date filter

{
  "type": "date",
  "value" : {}
}
Attribute
Definition

type string

One of the following values: string, boolean, number, money, date. For the number filter, this is a constant number.

value NumberRange

A NumberRange filter (see below). All numbers in millseconds.

Number filter

{
  "type": "number",
  "value" : 0|[]|{}
}
Attribute
Definition

type string

One of the following values: string, boolean, number, money, date. For the number filter, this is a constant number.

value number | number[] | NumberExpression | NumberRange

The filter value to apply, which can be a single value, multiple values, or more specific filters (see below).

Money filter

{
  "type": "money"
  "currencies" : [],
  "value" : []
}
Attribute
Definition

type string

One of the following values: string, boolean, number, money, date. For the money filter, this is a constant money.

currencies string

A collection of ISO 4217 currency code. optional

value number | number[] | NumberExpression | NumberRange

The filter value to apply, which can be a single value, multiple values, or more specific filters (see below).

NumberExpression

{
  "operator": "string",
  "value": 0
}
Attribute
Definition

operator string

One of the following operator values: ne, ge, gt, le, lt.

value number

The filter value to apply.

NumberRange

{
  "start": 0,
  "end": 0,
  "includeStart": true,
  "includeEnd": true,
}
Attribute
Definition

start number

The minimum value in the range.

end number

The maximum value in the range.

includeStart boolean

Is inclusive on the lower bound. optional

includeEnd boolean

Is inclusive on the upper bound. optional

Last updated