put_item: Put an item

Description Usage Arguments Value References Examples

View source: R/put_item.R

Description

Put an item into a Dynamo DB database

Usage

1
2
3
4
put_item(table, item, condition = NULL, return_value = c("NONE", "ALL_OLD"),
  ...)

update_item(table, item, return_value = c("NONE", "ALL_OLD"), ...)

Arguments

table

A character string specifying the table name, or an object of class “aws_dynamodb_table”.

item

A list of key-value pairs.

condition

Optionally, a “ConditionExpression” that determines whether the item is added. This can prevent overwriting. See User Guide: Condition Expressions.

return_value

A character string specifying whether to return previous values of the item.

...

Additional arguments passed to dynamoHTTP.

Value

A list.

References

API Guide: PutItem API Guide: UpdateItem

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
  tab <- create_table(
    table = "Music",
    attributes = list(Artist = "S"),
    primary_key = "Artist"
  )

  # put item
  put_item("Music", list(Artist = "No One You Know", SongTitle = "Call Me Today"))

  # cleanup
  delete_table(tab)

## End(Not run)

cloudyr/aws.dynamodb documentation built on Jan. 14, 2020, 4:56 a.m.