Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "id": "d7913a57-f458-4b81-8d6e-10f81e2b1dc2",
- "firstName": "John",
- "lastName": "Doe",
- "email": "johndoe@gmail.com",
- "companies" : [
- {
- "companyId": "6059be51-1e66-4f3a-9c8f-ced3bc89d562",
- "createdAt": 321321,
- "histories": [
- {
- "companyHistoryId": "dc9d1a57-fb82-4c25-a6cf-d27dfe114f8f",
- "content": "Company A was created.",
- "createdAt": 321321,
- "createdBy": "d7913a57-f458-4b81-8d6e-10f81e2b1dc2"
- }
- ],
- },
- ]
- }
- {
- "version" : "2017-02-28",
- "operation" : "UpdateItem",
- "key" : {
- "id": { "S": "${context.arguments.id}" },
- },
- "update" : {
- "expression" : "SET companies = list_append(if_not_exists(companies, :emptyList), :newCompany)",
- "expressionValues" : {
- ":emptyList": { "L" : [] },
- ":newCompany" : { "L" : [
- { "M": {
- "name": { "S" : "${context.arguments.name}" },
- "createdAt": { "N" : "${context.arguments.createdAt}" },
- "companyId": { "S": "$util.autoId()" },
- "isActive": { "BOOL" : true },
- "histories": { "L": [
- { "M": {
- "companyHistoryId": { "S": "$util.autoId()" },
- "content" : { "S" : "${context.arguments.name} was created." },
- "createdAt": { "N" : "${context.arguments.createdAt}" },
- "createdBy": { "S": "${context.arguments.id}" }
- }}
- ] }
- }}
- ] },
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement