Skip to content
v2.273.0

KeyCondition Class ​

Factory class for DynamoDB key conditions.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_appsync as appsync } from 'aws-cdk-lib';
const keyCondition = appsync.KeyCondition.beginsWith('keyName', 'arg');

Methods ​

and(keyCond: KeyCondition): KeyCondition // chainabledef and(self, key_cond: KeyCondition) -> KeyConditionpublic KeyCondition and(KeyCondition keyCond)public KeyCondition And(KeyCondition keyCond)func And(KeyCond KeyCondition) KeyCondition#
Conjunction between two conditions.
beginsWith(keyName: string, arg: string): KeyCondition // chainable@staticmethod def begins_with(key_name: str, arg: str) -> KeyConditionpublic static KeyCondition beginsWith(String keyName, String arg)public static KeyCondition BeginsWith(string keyName, string arg)func BeginsWith(KeyName *string, Arg *string) KeyConditionstatic#
Condition (k, arg).

True if the key attribute k begins with the Query argument.

between(keyName: string, arg1: string, arg2: string): KeyCondition // chainable@staticmethod def between(key_name: str, arg1: str, arg2: str) -> KeyConditionpublic static KeyCondition between(String keyName, String arg1, String arg2)public static KeyCondition Between(string keyName, string arg1, string arg2)func Between(KeyName *string, Arg1 *string, Arg2 *string) KeyConditionstatic#
Condition k BETWEEN arg1 AND arg2, true if k >= arg1 and k <= arg2.
eq(keyName: string, arg: string): KeyCondition // chainable@staticmethod def eq(key_name: str, arg: str) -> KeyConditionpublic static KeyCondition eq(String keyName, String arg)public static KeyCondition Eq(string keyName, string arg)func Eq(KeyName *string, Arg *string) KeyConditionstatic#
Condition k = arg, true if the key attribute k is equal to the Query argument.
ge(keyName: string, arg: string): KeyCondition // chainable@staticmethod def ge(key_name: str, arg: str) -> KeyConditionpublic static KeyCondition ge(String keyName, String arg)public static KeyCondition Ge(string keyName, string arg)func Ge(KeyName *string, Arg *string) KeyConditionstatic#
Condition k >= arg, true if the key attribute k is greater or equal to the Query argument.
gt(keyName: string, arg: string): KeyCondition // chainable@staticmethod def gt(key_name: str, arg: str) -> KeyConditionpublic static KeyCondition gt(String keyName, String arg)public static KeyCondition Gt(string keyName, string arg)func Gt(KeyName *string, Arg *string) KeyConditionstatic#
Condition k > arg, true if the key attribute k is greater than the Query argument.
le(keyName: string, arg: string): KeyCondition // chainable@staticmethod def le(key_name: str, arg: str) -> KeyConditionpublic static KeyCondition le(String keyName, String arg)public static KeyCondition Le(string keyName, string arg)func Le(KeyName *string, Arg *string) KeyConditionstatic#
Condition k <= arg, true if the key attribute k is less than or equal to the Query argument.
lt(keyName: string, arg: string): KeyCondition // chainable@staticmethod def lt(key_name: str, arg: str) -> KeyConditionpublic static KeyCondition lt(String keyName, String arg)public static KeyCondition Lt(string keyName, string arg)func Lt(KeyName *string, Arg *string) KeyConditionstatic#
Condition k < arg, true if the key attribute k is less than the Query argument.
renderTemplate(): stringdef render_template(self, ) -> strpublic String renderTemplate()public string RenderTemplate()func RenderTemplate() *string#
Renders the key condition to a VTL string.