Closed andreasthoelke closed 8 years ago
Hey, I'm not at an actual computer, but I think in general the problems you're seeing are around the declaration of attributes which aren't used in some combination of the key / index schema. If an attribute isn't used in either, it can't be declared in :attrs.
The last example is incorrect due the use of three entries in : keys - at best, this library will ignore the last item - the acceptable forms being [hash] or [hash range].
In your first non-working example, trimming :attrs down to only contain :name ought to fix it. Which won't affect your ability to attach the evicted attrs - or any others - to the items in the table.
Let me know if that works out, and what else I can do to help.
Thanks, this cleared up two misconceptions I had:
:attrs
is not a general schema of the table (dynamo doesn't have a schema), it’s rather a schema of the indexes defined in :keys
and :indexes
.. :keys
:keys
and :indexes
.. :keys
wrong: These can only have either one element (indicating a simple primary/secondary key/index) or two elements (key + sort key).So yes, everything works fine now. Thanks again!
Great - please don't hesitate to file any follow-up issues if you have any questions.
Thank you for hildebrand, it looks great!
I'm seeing some strange behaviour when trying to use
create-table!
without the:indexes
key in the table-spec. (Which I assume is optional based on http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html ?) E.g. this works:But this gives me an error (“validation-exception: The number of attributes in key schema must match the number of attributesdefinined in attribute definitions.”):
On the other hand this works:
However this gives me the same error as above:
This again works:
.. which made me expect that this would work, but it fails with the same error as above:
The way I understood it so far
:attrs
just defines mandatory fields:keys
are primary index columns which need to be mandatory fields defined in:attrs