BatchGetItem

Description

This function returns the attributes from one or more items from a table or tables. You must use a primary key to identify the items that you want to retrieve.

For more information, see BatchGetItem.

Category

History

ColdFusion (2021 release): Added this function.

Syntax

serviceHandle.batchGetItem(requestParameters)

Parameters

See request parameters of BatchGetItem.

Example

<cfscript> 
  cred={ 
    cred = { 
        "credentialAlias" : "myalias", 
        "vendorName" : "AWS", 
        "region" : "us-east-2", 
        "secretAccessKey" : "xxxxx", 
        "accessKeyId" : "xxxx" 
  } 
  } 
 
  conf={ 
    "serviceName"="DYNAMODB" 
  } 
 
  dynamo=getCloudService(cred, conf) 
  tableName="batchWriteMovie" 
 
  // get items from table 
  batchGetItemStruct={ 
    "RequestItems":{ 
    "#tableName#":{ 
      "Keys":[ 
        { 
          "year":2018, 
          "title":"Solo" 
        }, 
        { 
          "year":2018, 
          "title":"Hereditary" 
        } 
      ] 
    } 
    } 
  } 
  try{ 
    batchGetItemResponse=dynamo.batchGetItem(batchGetItemStruct,{ 
      "customResponse":true 
    }) 
    writeOutput("Items retrieved successfully") 
    writeDump(batchGetItemResponse) 
  } 
  catch(any e){ 
    writeDump(e) 
  } 
</cfscript> 

Output

BatchGetItem output
BatchGetItem output

 Adobe

Get help faster and easier

New user?

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online