FdbKeyRange

Namespace: FoundationDB.Client · class

Helpers for creating IFdbKeyRange instances

Methods

Between

static FdbRawKeyRange Between(Slice lowerInclusive, Slice upperExclusive)

Returns a range that will match all keys between two bounds

  • lowerInclusive — Inclusive lower bound
  • upperExclusive — Exclusive upper bound

static FdbKeyRange<TFromKey, TToKey> Between<TFromKey, TToKey>(TFromKey lowerInclusive, in TToKey upperExclusive)

Returns a range that will match all keys between this lower bound key and the given upper bound key

  • lowerInclusive — Inclusive lower bound
  • upperExclusive — Exclusive upper bound

static FdbKeyRange<TLowerKey, TUpperKey> Between<TLowerKey, TUpperKey>(in TLowerKey lowerKey, KeyRangeMode lowerMode, TUpperKey upperKey, KeyRangeMode upperMode)

Returns a range that will match all keys between this lower bound key and the given upper bound key

  • lowerKey — Key used to compute the lower bound of the range
  • lowerMode — Transformation applied to lowerKey
  • upperKey — Key used to compute the upper bound of the range
  • upperMode — Transformation applied to upperKey

Single

static FdbKeyRange<TKey, TKey> Single<TKey>(in TKey key)

Returns a range that matches only this key

  • key — Key that will be matched

Returns: Range that match only this key

Ex: FdbKeyRange.Single(subspace.GetKey(123)) will match only (..., 123), and will exclude any of its children (..., 123, ...).

StartsWith

static FdbKeyRange<TKey, TKey> StartsWith<TKey>(in TKey key, bool inclusive = false)

Returns a range that matches all the children of this key

  • key — Key that will be used as a prefix
  • inclusive — If true the key itself will be included in the range; otherwise, the range will start immediately after this key.

Returns: Range that matches all keys that start with key (included)

Ex: FdbKeyRange.StartsWith(subspace.GetKey(123)) will match all the keys of the form (..., 123, ...), but not (..., 123) itself.

Ex: FdbKeyRange.StartsWith(subspace.GetKey(123), inclusive: true) will match (..., 123) as well as all the keys of the form (..., 123, ...).