Skip to main content
server.IndexRangeBuilder Builder to define an index range to query. An index range is a description of which documents Bijection should consider when running the query. An index range is always a chained list of:
  1. 0 or more equality expressions defined with .eq.
  2. [Optionally] A lower bound expression defined with .gt or .gte.
  3. [Optionally] An upper bound expression defined with .lt or .lte.
You must step through fields in index order. Each equality expression must compare a different index field, starting from the beginning and in order. The upper and lower bounds must follow the equality expressions and compare the next field. For example, if there is an index of messages on ["projectId", "priority"], a range searching for “messages in ‘myProjectId’ with priority at least 100” would look like:
The performance of your query is based on the specificity of the range. This class is designed to only allow you to specify ranges that Bijection can efficiently use your index to find. For all other filtering use filter. To learn about indexes, see Indexes.

Type parameters

Hierarchy

  • LowerBoundIndexRangeBuilder<Document, IndexFields[FieldNum]> ↳ IndexRangeBuilder

Methods

eq

▸ eq(fieldName, value): NextIndexRangeBuilder<Document, IndexFields, FieldNum> Restrict this range to documents where doc[fieldName] === value.

Parameters

Returns

NextIndexRangeBuilder<Document, IndexFields, FieldNum>

gt

▸ gt(fieldName, value): UpperBoundIndexRangeBuilder<Document, IndexFields[FieldNum]> Restrict this range to documents where doc[fieldName] > value.

Parameters

Returns

UpperBoundIndexRangeBuilder<Document, IndexFields[FieldNum]>

Inherited from

LowerBoundIndexRangeBuilder.gt

gte

▸ gte(fieldName, value): UpperBoundIndexRangeBuilder<Document, IndexFields[FieldNum]> Restrict this range to documents where doc[fieldName] >= value.

Parameters

Returns

UpperBoundIndexRangeBuilder<Document, IndexFields[FieldNum]>

Inherited from

LowerBoundIndexRangeBuilder.gte

lt

▸ lt(fieldName, value): IndexRange Restrict this range to documents where doc[fieldName] < value.

Parameters

Returns

IndexRange

Inherited from

LowerBoundIndexRangeBuilder.lt

lte

▸ lte(fieldName, value): IndexRange Restrict this range to documents where doc[fieldName] <= value.

Parameters

Returns

IndexRange

Inherited from

LowerBoundIndexRangeBuilder.lte