dynamoose
Advanced tools
Changelog
Version 3.0.1
This release fixes a bug where the map
attribute property wouldn't work properly when passing it in as a key.
Please comment or contact me if you have any questions about this release.
map
property when passing it in as a key.Changelog
Version 3.0.0
Dynamoose v3 is here!!! This release is a significant upgrade to Dynamoose that includes many great features. The upgrade process for v2 to v3 is also significantly easier compared to the v1 to v2 upgrade process. We encourage everyone to upgrade to v3 as soon as possible. Although v2 will continue to receive bug fixes and security updates as needed for time being, v2 will not be maintained forever, so upgrading to v3 is highly recommended.
Please comment or contact me if you have any questions about this release.
dynamoose.aws
object will be impacted (if you are only using dynamoose.aws.ddb.local
, there will be no breaking changes).dynamoose.aws.sdk
has been removed.dynamoose.aws.ddb
now references a @aws-sdk/client-dynamodb
DynamoDB
instance instead of the previous AWS.DynamoDB
instance.
dynamoose.aws.converter
now uses the methods from @aws-sdk/util-dynamodb
.
input
has changed to convertToAttr
.output
has changed to convertToNative
.dynamoose.aws.ddb.DynamoDB
to create a new @aws-sdk/client-dynamodb
DynamoDB
instance.dynamoose.model.defaults
has been renamed to dynamoose.Table.defaults
.dynamoose.Table
instance, or whenever you make a DynamoDB request for a given model (ex. get
, create
, update
).Document
to Item
.
{"return": "document"}
to {"return": "item"}
and {"return": "documents"}
to {"return": "items"}
.set
Schema attribute settings are now used when retrieving items (ie. get
, query
, update
, etc).{"return": "request"}
as a setting into the following methods are now preformed asynchronously:
Model.get
Model.delete
Model.batchGet
Model.batchDelete
default
value of an empty object ({}
) or array ([]
) to the parent attribute.dynamoose.logger
is now an async function instead of an object. For example, dynamoose.logger.status()
is now (await dynamoose.logger()).status()
.
dynamoose-logger
package in order to use dynamoose.logger()
, otherwise an error will be thrown.seperator
to separator
in Combine type settings to fix typo.miliseconds
to milliseconds
in Date type settings to fix typo.dynamoose.type
object.
dynamoose.UNDEFINED
is now dynamoose.type.UNDEFINED
.dynamoose.THIS
is now dynamoose.type.THIS
.dynamoose.NULL
is now dynamoose.type.NULL
.new dynamoose.Schema({"id": "random"})
will now throw an error.Model.table.create.request()
has been replaced by Model.table().create({"return": "request"})
.listTagsOfResource
, tagResource
, untagResource
) required if update
is set to true.index.global
property has been removed within Schema Attribute Settings. It has been replaced with index.type
, which accepts "global"
or "local"
as values. This setting remains optional (however, the default value has changed).dynamoose.Instance
). This allows you easily make requests to multiple AWS DynamoDB regions.dynamoose.Table
class. dynamoose.model
now represents an entity or type of data (ex. User, Movie, Order), and dynamoose.Table
represents a single DynamoDB table. By default, whenever you first use a model, a dynamoose.Table
instance will be created for you, to ensure backwards compatibility with v2. If you want to create the table manually, you can change your code like so:// If you have the following code in v2:
const User = dynamoose.model("User", {"id": String});
// It will be converted to this in v3:
const User = dynamoose.model("User", {"id": String});
const DBTable = new dynamoose.Table("DBTable", [User]);
get
& set
modifier options to Schema settings to allow for Item wide modification.validate
method option to Schema settings to allow for Item wide validation.tags
setting to Table, to be able to add tags to a table.map
setting to Schema type settings to allow for easily converting DynamoDB attribute names to more human readable names (ex. pk
to userId
and sk
to orderId
). This can also be used for aliases. This also includes a defaultMap
property that can be used to overwrite what property name Dynamoose should use when retrieving an item from DynamoDB.dynamoose.type.ANY
type to allow for schema attributes to be any type. You can also set this on the schema
setting of a property to allow the object/array to have any children properties.tableClass
option to Table settings to allow for setting a table to DynamoDB's new infrequent access class option.table.create()
method to create a table manually.table.name
property to be able to access table name.table.hashKey
property to be able to access table's hash key.table.rangeKey
property to be able to access table's range key.model.name
property to be able to access model name.dynamoose.type.CONSTANT
helper function to create a constant type.dynamoose.type.COMBINE
helper function to create a combine type.schema.hashKey
& schema.rangeKey
properties to allow you to access the hash and range keys of your schemas.schema.indexAttributes
property that returns an array of strings with each string representing the attribute name of each index.item.withDefaults
function that will return a new object with default values applied.model
as an attribute name in your Schema would cause random TypeMismatch errors./version
page to documentation to easily view the Dynamoose npm version & Git commit SHA of the documentation you are viewing.npm install
, then running npm run build:sourcemap
. The generated source map files will be located in the dist
folder.source-map-support
package into devDependencies
.Changelog
Version 2.8.7
Version 3.0.0 of Dynamoose has been released. This is the corresponding v2 release. v2 will continue to receive bug fixes and security updates as needed for time being. However, we recommend that you upgrade to v3 as soon as possible, as v2 will not be maintained forever.
Please comment or contact me if you have any questions about this release.
Changelog
Version 2.8.6
This release includes a few bug fixes.
Please comment or contact me if you have any questions about this release.