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

Dapatkan bantuan lebih cepat dan lebih mudah

Pengguna baru?

Adobe MAX 2024

Adobe MAX
Konferensi Kreativitas

14–16 Oktober Miami Beach dan online

Adobe MAX

Konferensi Kreativitas

14–16 Oktober Miami Beach dan online

Adobe MAX 2024

Adobe MAX
Konferensi Kreativitas

14–16 Oktober Miami Beach dan online

Adobe MAX

Konferensi Kreativitas

14–16 Oktober Miami Beach dan online