Struct SortKeyCondition
- Namespace
- DynaSharp
- Assembly
- DynaSharp.dll
A condition on the sort key of a query. Only what DynamoDB allows in a key condition can be expressed: one comparison, a range or a
prefix, and no <>. The default value means no condition, which reads the whole partition.
public readonly struct SortKeyCondition
- Inherited Members
Remarks
A generated key builder has these conditions for its template, from the values of its placeholders: Order.Keys.Sk.Between(from, to). The ones here are for a value that is at hand already, such as a
sort key of a table without a mapped type. Strings compare by their UTF-8 bytes, so a condition on the text of a composite key means what those bytes mean.
The generated ranges go by the template: Between(from, to) includes every key at to, and Range(from, to) ends before the keys at to. A value is cut to the format of its placeholder first,
so under {OrderDate:yyyy-MM-dd} Between(march1, march31) reads all of March 31.
Methods
BeginsWith(string)
Selects sort keys that start with a prefix, the way to read one kind of item of a partition.
public static SortKeyCondition BeginsWith(string prefix)
Parameters
prefixstringThe prefix, for example
ORDER#.
Returns
- SortKeyCondition
The condition.
Between(AttributeValue, AttributeValue)
Selects sort keys in a range, both bounds included.
public static SortKeyCondition Between(AttributeValue low, AttributeValue high)
Parameters
lowAttributeValueThe low bound.
highAttributeValueThe high bound.
Returns
- SortKeyCondition
The condition.
Eq(AttributeValue)
Selects the one sort key equal to a value.
public static SortKeyCondition Eq(AttributeValue value)
Parameters
valueAttributeValueThe value.
Returns
- SortKeyCondition
The condition.
Ge(AttributeValue)
Selects sort keys from a value on.
public static SortKeyCondition Ge(AttributeValue value)
Parameters
valueAttributeValueThe value.
Returns
- SortKeyCondition
The condition.
Gt(AttributeValue)
Selects sort keys above a value.
public static SortKeyCondition Gt(AttributeValue value)
Parameters
valueAttributeValueThe value.
Returns
- SortKeyCondition
The condition.
Le(AttributeValue)
Selects sort keys up to a value.
public static SortKeyCondition Le(AttributeValue value)
Parameters
valueAttributeValueThe value.
Returns
- SortKeyCondition
The condition.
Lt(AttributeValue)
Selects sort keys below a value. Strings compare by their UTF-8 bytes.
public static SortKeyCondition Lt(AttributeValue value)
Parameters
valueAttributeValueThe value.
Returns
- SortKeyCondition
The condition.