Elegant DynamoDB object modeling for Typescript.
Let's face it, all good databases need good model casting. DynamoDB is powerful but libraries that used it were not. That's where Dyngoose comes in.
- Cast your tables, attributes, and indexes using TypeScript classes.
- Generate your CloudFormation templates based on your code, or perform your table operations on demand; see Deployment.
- Intelligent and powerful querying syntax, see Querying.
- Selectively update item attributes, prevents wasteful uploading of unchanged values.
- DynamoDB Accelerator (DAX) and Amazon X-Ray support, see Connections.
- Optimizes connection to DynamoDB HTTP service using Keep-Alive, see Code.
- Incredibly easy local development, with supporting for seeding a local database.
- Supports conditional writes, see Saving.
// Perform table operationsawait Card.createTableawait Card.deleteTable// Creating recordscard.id = 100card.title = 'Title'// note: Card.new is correct, this is a custom method that allows for a strongly-typed object// Save a recordawait card.save// Batch Putawait Card.documentClient.batchPut// Get record by the primary keyawait Card.primaryKey.get100, 'Title'// BatchGet// This array is strongly typed such as Array<[number, string]> so don't worry.await Card.primaryKey.batchGet// Query// Queries are always strongly typed. (['>=', T] | ['=', T] ...)await Card.primaryKey.query// Delete recordawait card.delete
TS Compiler Setting
Dyngoose utilizes TypeScript decorators, to use them you must enable them within your
I originally based a lot of of this work on Dynamoose, reworking it for TypeScript and adding adding better querying logic. About two years later, I pulled in some work from dynamo-types and reworked it further to make what has become Dyngoose. I want to thank the creators and all the people who worked on both of those projects.