Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Snap type:

Write


Description:

This Snap deletes an item or a bunch of items (based on batch size) from an existing table in AWS DynamoDB. 


  • Expected upstream SnapsAny Snap that provides a document output view, such as Structure or a JSON Generator Snap. 
  • Expected downstream SnapsAny Snap that has a document input view, such as Filter or Data or JSON Formatter.
  • Expected inputThe table's key schema is suggested on input view. The values for the record keys are passed from the input view. 
  • Expected outputThis Snap returns an HTTP response code 200 on success. 

 
Note: The delete operation performed by this Snap is Idempotent, that means even when the given input records do not exist, the Snap still gives an HTTP 200 response.

Prerequisites:

[None]


Support and limitations:
  • Ultra pipelines: May work in Ultra Pipelines.
  • Spark mode(Deprecated):  Not supported in Spark mode.


Account: 

This Snap uses account references created on the Accounts page of SnapLogic Manager to handle access to this endpoint. 

See DynamoDB Account for information on setting up this type of account.


Views:


InputThis Snap has exactly one document input view.
OutputThis Snap has exactly one document output view.
ErrorThis Snap has at most one document error view and produces zero or more documents in the view.


Settings

Label


Required. The name for the Snap. You can modify this to be more specific, especially if you have more than one of the same Snap in your pipeline.

Table name



Required. The name of the table to delete the data from. This property is suggestible, that shows the list of the tables in the database.
Example: Thread
Default value: [None]

Delete condition


Specifies a condition to be used on non-key attributes for performing the delete operation.

Note

Applicable only when batch size is 1.

Default value: [None]  


Batch size

 

Specifies the number of records to be deleted in a single request.

Default value:1


Output deleted records

 

Specifies whether or not to display the original records in the output view. 
Default value: Not selected  

Expression attribute values

This property is used to specify the placeholders to be used in delete condition property above. Refer here for more information.

Example:

 Attribute TypeValue
 :val1 SAmazon DynamoDB


  • Attribute name must always begin with a colon(:val1)
  • Type will be S for string, N for number and so on
  • The Value is the actual literal to be used in the delete condition 

Scenario:

Suppose, a table T1 has two columns A1 and A2 where A1 is a key- attribute and A2 is a non-key attribute. A record having value for A2 as 'Snap' needs to be deleted. We cannot enter A2=Snap in the delete condition directly , instead assign a placeholder for the value and hence, we define an Attribute :v1 of Type S, and Value as Snap. We will then give A2=:v1 in the delete condition.


 Attribute TypeValue
 :v1 SSnap


Execute during preview


This property enables you to execute the Snap during the Save operation so that the output view can produce the preview data.  

Default value: Not selected




Expand
title DynamoDB Complex types

DynamoDB Complex types:

  • Sets
  • Lists
  • Map


Sets
String Set [SS]

A values of this type contains a set of strings delimited by double quotes as follows:

Pattern: [String object 1, String object 2, ........, String Object n]

Example: ["Snaplogic", "San Mateo", "Pipeline"]


Number Set [NS]

A value of this type contains a set of numbers delimited by double quotes as follows:

Pattern: [Number Obj1, Number Object2,...., Number Object n]

Example: ["123", "24.56", "-35", "-21.456","0"]

Binary Set [BS]

A value of this type contains a set of base64-encoded binary data objects delimited by double quotes as follows:

Pattern: [ Binary Object 1, Binary Object 2,...Binary Object n]

Example: ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]


List (L):

A value of this type contains a set of objects. Each object further can be of any type (String, Number, String Set, Map, List etc.,). In general, the List object resembles a JSON array.

Pattern: [ object 1, object 2, ........, Object n]

Example: [{"N":"3"},{"S":"-7.5"},{"B":"U3Vubnk="},{"L":[{"N":"-45.56"},{"M":{"Name":{"S":"ahmed"}}}]},{"M":{"name":{"S":"syed"}}},{"SS":["a","b"]},{"BS":["U3Vubnk="]},{"NS":["23","45"]}]


Map(M):

A value of this type contains a set of key- value pairs. Keys are always strings, whereas values can be of any type (String, Number, String Set, Map, List etc.,). In general, the Map object resembles a JSON array.
Pattern: {"Key1":Object1, "Key2": Object2......"Keyn": Objectn}

Example: {"id":{"S":"snaplogic"}, "orgs":{"L":[{"S":"uat"}, {"S":"qa"}]}, "admins":{"L":[{"M":{"name":{"S":"a"}}}, {"M":{"name":{"S":"45"}}}]}}


The pipeline using the Binary Set types for the Delete Table Item Snap:

 


Example


In this pipeline, the DynamoDB Delete Item Snap, deletes a record from the table DynamoDB_Delete1 using a delete condition by defining a placeholder.

In the upstream Mapper Snap, supply the key (737314009510) of an item to be deleted and define its placeholder value ($values1) for the attribute to be used in the delete condition.  

 


In the DynamoDb Delete Table Item Snap,  we want to delete a record from the table DynamoDB_Delete1, when the delete condition is Product = :val1, where the attribute :val1 = $Values1. 

  


Successful execution of the pipeline displays the HTTP status code 200 in the output view: 

Insert excerpt
DynamoDB Snap Pack
DynamoDB Snap Pack
nopaneltrue