X4 Produktdokumentation

Operation: Query

With the Query operation of the Amazon S3 DynamoDB Connector, you call a subset of elements within a table. Conditions are specified for the various attributes. For more information about the input file that calls the query, see https://softproject-confluence-documentation.atlassian.net/wiki/spaces/X4Documentation/pages/edit-v2/547651617#Input.

For more information on other operations of the Amazon S3 DynamoDB Connector, see Amazon S3 DynamoDB Connector.

Parameters

keyID

Access key ID for requests to Amazon Web Services (AWS)

Note:

The credentials are sent to the adapter via parameters. There are various configuration options. For more information, see Setting Up Credentials.

Possible values:

Any string with the access key ID, e.g. AKIAIOSFODNN7EXAMPLE

secretKey

Secret access key for requests to AWS

Note:

The credentials are sent to the adapter via parameters. There are various configuration options. For more information, see Setting Up Credentials.

Possible values:

Any string with the secret access key, e.g. wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

region

Region of the domains

Note:

Buckets created in a specific region cannot be invoked from another region. For more information, see Regions and Endpoints.

Possible values:

Any string with the name of the region, e.g. us-east-2

tableName

✳️

This parameter is required for this operation.

Table name

Possible values:

String with the table name according to the following name rules:

  • All names must be UTF-8 encoded

  • Table names are case-sensitive

  • Table names and index names must be between 3 and 255 characters long and must contain only the following characters:

    • a-z

    • A-Z

    • 0-9

    • _ (Underscore)

    • - (Hyphen)

    • . (period)

  • Attribute names must be between 1 and 255 characters long.

partitionKey, partitionType, and partitionKeyValue

✳️

The partitionKey parameter is required for this operation and the comparator is always "=".

Elements of the primary table key

Note:

If the sortKey is available, the comparator between partitionKey and sortKey is "AND".

Permitted operators: =, >, <, >=, <=, !=, BETWEEN, begins_with

Possible values:

  • PartitionKey: Name of the partition key

  • PartitionType: Partition type

    • S: The attribute is a string

    • N: The attribute is a number

    • B: The attribute is of the Binary type

  • PartitionKeyValue: Value of the element

sortKey, sortType, and sortKeyValue

Elements of the primary table key

Note:

If the sortKey is available, the comparator between partitionKey and sortKey is "AND".

Permitted operators: =, >, <, >=, <=, !=, BETWEEN, begins_with

Possible values:

  • SortKey: Name of the sort key

  • SortType: Sort type

    • S: The attribute is a string

    • N: The attribute is a number

    • B: The attribute is of the Binary type

  • SortKeyValue: Value of the element

consistentRead

DynamoDB uses eventually consistent reads unless otherwise specified. Read operations such as GetItem and Query provide a ConsistentRead parameter. If this parameter is set to true, DynamoDB uses strongly consistent reads during operation.

Status values

1

The adapter operation was executed successfully

0

The operation was not completed, but no error occurred.

-1

The operation failed due to a technical error.

Input

The adapter expects a predefined XML structure as input.

The <Query/> parent element contains three elements:

KeyCondition

Contains only the specific partitionKey and, if available, SortKey that meet the following conditions:

  • The comparator between partitionKey and SortKey is always "AND".

  • partitionKey is required and is always used with "=".

  • If SortKey is used, the following operators can be used: =, >, <, >=, <=, !=, BETWEEN, begins_with

  • partitionKey and SortKey cannot match words reserved for AWS DynamoDB. For more information on primary keys, see the corresponding Amazon DynamoDB documentation:

OtherFilters

Specifies conditions for the remaining attributes that are not part of the primary key. The affected attributes cannot match words reserved for AWS Dynamo DB.

For more information on primary keys, see the corresponding Amazon DynamoDB documentation:

QueryParameters

Specifies the mapping between the parameters used and your corresponding values. The type of each parameter must be specified.

<?xml version="1.0" encoding="UTF-8" ?>
<Query>
	<KeyCondition>ID=:param1</KeyCondition>
	<OtherFilters>Colors[3].Profession=:param3 or DocumentCode=:param2</OtherFilters>
	<QueryParameters>
		<Parameter type="N" alias=":param1" value="5" />
		<Parameter type="B" alias=":param2" value="cXdycWZnZGFzMTIyMzQ1NXNkZmZmcg==" />
		<Parameter type="S" alias=":param3" value="Programmer" />
	</QueryParameters>
</Query>

Output

The adapter returns an XML document with a Result parent element.

The hasMorePages attribute specifies whether the result has more pages to display or not. This is useful for comprehensive answers. For each element that meets the query conditions, an Item element is created that contains all the attributes.

<?xml version="1.0" encoding="UTF-8" ?>
<Result hasMorePages="false">
	<Item>
		<Attribute value="{Phone=637559681, Bonus=true, DocumentCode=[B@231dee4d, Profession=Programmer}" name="Cars" />
		<Attribute value="34666777888" name="Phone" />
		<Attribute value="[Red, Green, Blue, {Phone=637559681, Bonus=true, DocumentCode=[B@5857d888, Profession=Programmer}]" name="Colours" />
	<Attribute value="true" name="Bonus" />
	<Attribute value="5" name="ID" />
	<Attribute value="Luis" name="Name" />
	</Item>
</Result>