Skip to content

v1.1.0

Compare
Choose a tag to compare
@mobsense mobsense released this 04 Apr 01:54
· 1085 commits to main since this release

Minor Milestone Release

Features

  • Add one-to-many attribute mapping
  • Support various binary types: Buffer, ArrayBuffer, DataView
  • Add params.transform for custom data format transformations
  • Add schema.index.follow to set a GSI into a global follow mode
  • Updated doc

One to Many attribute mapping

The schema field map property can be used to set an alternate or shorter attribute name when storing in the database. Previously, this map value was a simple string which defined the real attribute name.

This release allows the map value to be a two part pair of the form: 'obj.name'. Using this form the item property will be stored in an object attribute named "obj" with the given name. This allows multiple item properties to be aggregated together into a single attribute for storage in the DynamoDB table.

This is most useful for GSIs which project keys and a single data field to minimize the storage footprint of the index. Using one-to-many attribute mappings, multiple models (entities) can project different attributes into a single GSI data attribute. When coupled with sparse indexes, this makes using GSIs much more flexible and cost effective to implement your query access patterns.

Fixes

See