electrodb
Advanced tools
Changelog
[3.0.1]
{ compare: "attributes" }
used incorrect expression comparisons that impacted lte
queries on indexes with a single composite key.Changelog
[3.0.0]
v3
, query operations that used the gt
, lte
, or between
methods would incur additional post-processing, including additional filter expressions and some sort key hacks. The post-processing was an attempt to bridge an interface gap between attribute-level considerations and key-level considerations. Checkout the GitHub issue championed by @rcoundon and @PaulJNewell77 here to learn more. With v3
, ElectroDB will not apply post-processing to queries of any type and abstains from adding implicit/erroneous filter expressions to queries by default. This change should provide additional control to users to achieve more advanced queries, but also introduces some additional complexity. There are many factors related to sorting and using comparison queries that are not intuitive, and the simplest way to mitigate this is by using additional filter expressions to ensure the items returned will match expectations. To ease migration and adoption, I have added a new execution option called compare
; To recreate v2
functionality without further changes, use the execution option { compare: "v2" }
. This value is marked as deprecated and will be removed at a later date, but should allow users to safely upgrade to v3
and experiment with the impact of this change on their existing data. The new compare
option has other values that will continue to see support, however; to learn more about this new option, checkout Comparison Queries.validate
callback on attributes now expects a strict return type of boolean
. Additionally, the semantic meaning of a boolean response has flipped. The callback should return true
for "valid" values and false
for "invalid" values. If your validation function throws an error, ElectroDB will still behave as it previously did in v2
, by catching and wrapping the error.limit
on queries now only applies a Limit
parameter to its request to DynamoDB. Previously, the limit
option would cause ElectroDB to effectively "seek" DynamoDB until the limit was at least reached. The execution option count
can be used in similar cases where limit
was used, but performance may vary depending on your data and use case.includeKeys
and raw
were deprecated in version 2.0.0
and have now been removed in favor of the execution option data
. To migrate from v2
, use the options { data: "includeKeys" }
and { data: "raw" }
respectively.delete
Changelog
[2.15.0] - 2024-09-19
@aws-sdk/lib-dynamodb
dependency from pinned version 3.395.0
to latest release ^3.654.0
. This impacts users using the v3 aws-sdk.@aws-sdk/util-dynamodb
for unmarshalling functionality.Changelog
[2.14.3] - 2024-07-29
update
and patch
methods would not correctly form the complete sort key value for the index. This would prevent impacted items from being queried via an Entity, though they could be queried via a collection on a Service. Thank you to github users @daniel7byte and @santiagomera for raising this issue!Changelog
[2.14.2] - 2024-07-07
@aws-sdk/lib-dynamodb
. The change resulted in the error Error: Cannot find module '@aws-sdk/lib-dynamodb/dist-cjs/commands/utils'
. This change updates ElectroDB's dependency version to the static version 3.395.0
, a version known to be compadible. Thank you github users @miyamonz, @kevinlonigro, @srodriki, @pablote, @sargisshahinyan, and @arpadgabor!Changelog
[2.14.1] - 2024-05-17
undefined
. This caused empty strings, zero values, and the boolean value false
to incorrectly be considered missing.Changelog
[2.14.0] - 2024-04-29
condition
usage. Discussion inside the issue ticket revealed complexities associated with the implementation of the condition
callback. Previously, a callback returning false
would simply not write the fields associated with an index on update. Through discussion with @sam3d and @nonken, it was revealed that this behavior could lead to inconsistencies between indexes and attributes. Furthermore, this behavior did not align with user expectations/intuitions, which expected a false
response to trigger the removal of the item from the index. To achieve this, it was discussed that the presence of a condition
callback should add a new runtime validation check on all mutations to verify all member attributes of the index must be provided if a mutation operation affects one of the attributes. Previously ElectroDB would validate only that composite members of an index field (a partition or sort key) within an index were fully provided; now, when a condition callback is present, it will validate that all members from both fields are provided. If you are unable to update/patch all member attributes, because some are readOnly, you can also use the composite method on update and patch. More information and the discussion around the reasoning behind this change can be found here. Failure to provide all attributes will result in an Invalid Index Composite Attributes Provided Error.Changelog
[2.13.0] - 2023-12-28
count
which allows you to specify a specific item count to return from a query. This is useful for cases where you must return a specific/consistent number of items from a query, a deceptively difficult task with DynamoDB and Single Table Design.Changelog
[2.12.3] - 2023-12-26
undefined
cursor (currently typed as string | null
) when using the raw:true
execution option. Fixed to return null
instead of undefined
../library-data.json
and test.csv
, accidentally published in version 2.12.2
.