{"action":"opened","issue":{"url":"https://api.github.com/repos/aws-amplify/amplify-js/issues/2463","repository_url":"https://api.github.com/repos/aws-amplify/amplify-js","labels_url":"https://api.github.com/repos/aws-amplify/amplify-js/issues/2463/labels{/name}","comments_url":"https://api.github.com/repos/aws-amplify/amplify-js/issues/2463/comments","events_url":"https://api.github.com/repos/aws-amplify/amplify-js/issues/2463/events","html_url":"https://github.com/aws-amplify/amplify-js/issues/2463","id":395880316,"node_id":"MDU6SXNzdWUzOTU4ODAzMTY=","number":2463,"title":"How to update/query/scan in DynamoDB using Amplify?","user":{"login":"chai86","id":43324724,"node_id":"MDQ6VXNlcjQzMzI0NzI0","avatar_url":"https://avatars0.githubusercontent.com/u/43324724?v=4","gravatar_id":"","url":"https://api.github.com/users/chai86","html_url":"https://github.com/chai86","followers_url":"https://api.github.com/users/chai86/followers","following_url":"https://api.github.com/users/chai86/following{/other_user}","gists_url":"https://api.github.com/users/chai86/gists{/gist_id}","starred_url":"https://api.github.com/users/chai86/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chai86/subscriptions","organizations_url":"https://api.github.com/users/chai86/orgs","repos_url":"https://api.github.com/users/chai86/repos","events_url":"https://api.github.com/users/chai86/events{/privacy}","received_events_url":"https://api.github.com/users/chai86/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-01-04T10:38:19Z","updated_at":"2019-01-04T10:38:19Z","closed_at":null,"author_association":"NONE","body":"I would like to update a field in my DynamoDB table called 'AppTable' using the AWS-Amplify methods that were generated when I created the corresponding CRUD cloud-api (e.g. PUT, GET, POST, DELETE).\r\n\r\nThese few API methods reside in awsmobilejs/backend/cloud-api/AppTable/app.js, but they are not comprehensive enough!\r\n\r\nI can simply use API.put to add to this table. e.g:\r\n\r\n`apiResponse = API.put('AppTableCRUD', path, body)`\r\n```\r\n\r\nbody: {\r\n    \"uploaderBool\": true,\r\n    \"userId\": 'user1',\r\n    \"itemId\": '10005',\r\n    \"Username\": \"first_app_user\",\r\n    \"Email\": \"user@myapp.com\",\r\n    \"NumberList\": \r\n       [\r\n        \"7.9\",\r\n        \"5.7\",\r\n        \"3.4\",\r\n        \"4.9\"\r\n       ],\r\n    \"AverageNumber\":[\r\n        \"5.5\"\r\n       ],\r\n     }\r\n    }\r\n\r\n```\r\nWhat i want to do, is update the NumberList field with a function in my react-native app, count how many numbers in the list on DynamoDB, then calculate/write an updated number called AverageNumber.\r\n\r\nIf i use a current API.put method i have to put in this ENTIRE body everytime (this list could be hundreds of thousand of entries so Get, then Put with a single update is absurd).\r\n\r\nHow do i just append a single number to the NumberList and update the AverageNumber fields?\r\n\r\nAlso how do you use the .scan() method that DynamoDB has?\r\n"}}
{"actor":{"display_login":"chai86"}}