[英]AWS DynamoDB CLI command not working
I am unable to execute the put-item command via the command line - sample below. 我无法通过命令行执行put-item命令-下面的示例。
C:\Users\Ishtiaque>aws dynamodb put-item --table-name weatherstationdata --item '{"stationid":{"S":"000001"},"dateandtime" : {"S": "2015/12/25 00:00"},"temperature": {"N" : "0"}}' --profile LOAdmin
Unknown options: {S:, 2015/12/25 00:00},temperature:, {N, :, 0}}', :
I have also tried the "\\" switch eg: 我也尝试过“ \\”开关,例如:
C:\Users\Ishtiaque>aws dynamodb put-item --table-name weatherstationdata --item '{\"\stationid":{\"\S":\"\000001"},"dateandtime" : {\"\S": \"\2015/12/25 00:00"},\"\temperature": {\"\N" : \"\0"}}' --profile LOAdmin
But still unsuccessful. 但是仍然没有成功。
I think it is something related to the "" sign but not sure how else resolve. 我认为这与“”符号有关,但不确定如何解决。
I can crate item from the console and when use the 'get-item' command, I face a similar error. 我可以从控制台创建项目,并且在使用“ get-item”命令时遇到类似的错误。
Your expression looks ok but if you have complex JSon you can create a new JSon file file.json 您的表情看起来还不错,但是如果您使用复杂的JSon,则可以创建一个新的JSon文件file.json。
{
"dateandtime": {
"S": "2015/12/25 00:00"
},
"stationid": {
"S": "000001"
},
"temperature": {
"N": "0"
}
}
and then pass it as expression to your command 然后将其作为表达式传递给您的命令
aws dynamodb put-item --table-name weatherstationdata \
--item file://item.json --profile LOAdmin
You should make sure not to include space after the key in Json so something like this would work in CLI 您应该确保在Json的键后不要包含空格,以便在CLI中可以执行类似的操作
aws dynamodb put-item --table-name weatherstationdata --item '{"stationid": {"S": "000001"},"dateandtime": {"S": "2015/12/25 00:00"},"temperature": {"N": "0"}}' --profile LOAdmin
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.