You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You're checking the length of the string with size when it should actually be bytesize. Also, the length of things aren't constrained unless they're a primary or range key.
.size and .bytesize on a string are the same thing since a character is a byte and .size returns the number of characters.
Also, the size limit applies to the object as a whole. In fact you cannot store items greater than 400KB (so the limit should be raised to 400KB from 64KB which is the old limit). This check is somewhat pointless though since it doesn't check total item size, but is still somewhat useful as a sanity check.
The strings in DynamoDB are UTF-8 (it says in one of the links I put in the original post), which doesn't guarantee that one character is one byte in length. For more information, this is an excellent read: http://www.joelonsoftware.com/articles/Unicode.html.
When you call
write_attribute
here: https://github.com/Veraticus/Dynamoid/blob/master/lib/dynamoid/fields.rb#L73You're checking the length of the string with
size
when it should actually bebytesize
. Also, the length of things aren't constrained unless they're a primary or range key.Relevant documentation:
The text was updated successfully, but these errors were encountered: