And I want to retrieve the user having actually email together "test
The following applies to the Node.js AWS SDK in the AWS Lambda environment:
This to be a rough one because that me. Ns ran into this trouble when make the efforts to use the getItem method. No issue what ns tried ns would proceed to receive this error. I finally uncovered a equipment on the AWS forum: https://forums.aws.amazon.com/thread.jspa?threadID=208820
Inexplicably, the apparent solution problems with all AWS documentation the I can find.
You are watching: The provided key element does not match the schema
Here is the password which operated for me:
var doc = require("dynamodb-doc");var dynamo = new doc.DynamoDB();var params = params.TableName = "ExampleTable";var key = "ExampleHashKey": "1" ;params.Key = key;dynamo.getItem(params, function(err, data) if (err) console.log(err); else console.log(data));
enhance this prize
answer Nov 5 "15 in ~ 1:02
44111 yellow badge44 silver- badges22 bronze badges
include a comment |
To questions on fields which room not the hash vital you should use a an international Secondary table of contents (GSI). Take it a look at this AWS short article for more details on GSI"s.
UPDATE Feb 2015: it is now possible to add a GSI come an existing table. See the Amazon Docs for much more details.
Sadly girlfriend cannot include a GSI come an present DynamoDB table so you"ll need to develop a new table and also port your data if this is something you really need to query on.
See more: Practice And Specific Training Can Improve Components Of Skill-Related Fitness Limited By Heredity.
From the DynamoDB FAQ:
Q: exactly how do I create a worldwide secondary index for a DynamoDB table?
All GSIs connected with a table should be mentioned at table development time. At this time, that is not feasible to include a GSI after the table has been created. For in-depth steps on developing a Table and also its indexes, check out here. You can create a maximum of 5 an international secondary indexes every table.
If you perform not desire to port her data friend could consider creating a 2nd DynamoDB table through the email as a hash vital and the hash the the parent document to usage as a lookup into your key data table however as you deserve to imagine this isn"t precisely an optimal solution and also it comes with its very own headaches of keeping it in synch v your master table.