如何使用cloud-api自动生成的API从表中获取所有项目

时间:2018-02-21 23:19:21

标签: amazon-web-services amazon-dynamodb aws-mobilehub

我正在研究小型React Native项目。我确实使用了MobileHub并创建了简单的Logs表(我正在遵循该教程:https://docs.aws.amazon.com/aws-mobile/latest/developerguide/react-native-access-databases.html)。

Path to be used on API for get and remove an object should be like:
/Logs/object/:LogID/:LogKey

Path to be used on API for list objects on get method should be like:
/Logs/:LogID

JSON to be used as data on put request should be like:
{
  "LogValue": "INSERT VALUE HERE",
  "LogTime": "INSERT VALUE HERE",
  "LogID": "INSERT VALUE HERE",
  "LogKey": "INSERT VALUE HERE"
}
To test the api from the command line (after awsmobile push) use this commands
awsmobile cloud-api invoke LogsCRUD <method> <path> [init]

我在数据库中插入任何内容都没有问题(使用:API.put('LogsCRUD','/ Logs',data),或获取单个项目(API.get('LogsCRUD','/ Logs / 1) ')),但我找不到任何想法如何从表中获取所有项目。我检查了很多东西,并试图通过随机名称来解决它,但没有任何效果。

0 个答案:

没有答案