@aws-lite/dynamodb

中文文档
0.3.9发布于 2024/12/24Apache-2.0ES Module零依赖近 30 天下载 22.3万

Official aws-lite plugin for DynamoDB

原始使用文档
文档目录60 节
  1. Install
  2. Reference
  3. Methods
  4. BatchExecuteStatement
  5. BatchGetItem
  6. BatchWriteItem
  7. CreateBackup
  8. CreateGlobalTable
  9. CreateTable
  10. DeleteBackup
  11. DeleteItem
  12. DeleteTable
  13. DescribeBackup
  14. DescribeContinuousBackups
  15. DescribeContributorInsights
  16. DescribeEndpoints
  17. DescribeExport
  18. DescribeGlobalTable
  19. DescribeGlobalTableSettings
  20. DescribeImport
  21. DescribeKinesisStreamingDestination
  22. DescribeLimits
  23. DescribeTable
  24. DescribeTableReplicaAutoScaling
  25. DescribeTimeToLive
  26. DisableKinesisStreamingDestination
  27. EnableKinesisStreamingDestination
  28. ExecuteStatement
  29. ExecuteTransaction
  30. ExportTableToPointInTime
  31. GetItem
  32. ImportTable
  33. ListBackups
  34. ListContributorInsights
  35. ListExports
  36. ListGlobalTables
  37. ListImports
  38. ListTables
  39. ListTagsOfResource
  40. PutItem
  41. Query
  42. RestoreTableFromBackup
  43. RestoreTableToPointInTime
  44. Scan
  45. TagResource
  46. TransactGetItems
  47. TransactWriteItems
  48. UntagResource
  49. UpdateContinuousBackups
  50. UpdateContributorInsights
  51. UpdateGlobalTable
  52. UpdateGlobalTableSettings
  53. UpdateItem
  54. UpdateTable
  55. UpdateTableReplicaAutoScaling
  56. UpdateTimeToLive
  57. Usage
  58. Example
  59. DynamoDB methods
  60. Learn more

@aws-lite/dynamodb

Official aws-lite plugin for DynamoDB

Maintained by: @architect

Install

npm i @aws-lite/dynamodb

Optionally install types:

npm i -D @aws-lite/dynamodb-types

Reference

Reference documentation with examples at aws-lite.org

Methods

BatchExecuteStatement

Canonical AWS API doc

Properties:

  • Statements (array) [required]
    • Array of PartiQL statements representing the batch being run
  • ReturnConsumedCapacity (string)
    • Return throughput consumption in response, can be set to one of: INDEXES, TOTAL, or NONE

BatchGetItem

Canonical AWS API doc

Properties:

  • RequestItems (object) [required]
    • An object containing >=1 table names and, for each table, an object describing >=1 items to get
  • ReturnConsumedCapacity (string)
    • Return throughput consumption in response, can be set to one of: INDEXES, TOTAL, or NONE

BatchWriteItem

Canonical AWS API doc

Properties:

  • RequestItems (object) [required]
    • An object containing >=1 table names and, for each table, an object describing >=1 items to write
  • ReturnConsumedCapacity (string)
    • Return throughput consumption in response, can be set to one of: INDEXES, TOTAL, or NONE
  • ReturnItemCollectionMetrics (string)
    • Return collection metrics in response, can be set to: SIZE, or NONE (default)

CreateBackup

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • BackupName (string) [required]
    • Specified name of the backup

CreateGlobalTable

Canonical AWS API doc

Properties:

  • GlobalTableName (string) [required]
    • DynamoDB table name
  • ReplicationGroup (array) [required]
    • AWS regions where the global table needs to be created

CreateTable

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • AttributeDefinitions (array) [required]
    • Array of attributes that describe the primary (and sort) schema for the table
  • KeySchema (array) [required]
    • Attributes that make up the primary key for a table or index. The attributes in KeySchema must also be defined in the AttributeDefinitions array
  • BillingMode (string)
    • Set how the table is charged for read/write throughput: PROVISIONED, or PAY_PER_REQUEST
  • DeletionProtectionEnabled (boolean)
    • Enable or disable deletion protection
  • GlobalSecondaryIndexes (array)
  • LocalSecondaryIndexes (array)
  • ProvisionedThroughput (object)
    • Provisioned throughput setting
  • SSESpecification (object)
    • Server-side encryption settings
  • StreamSpecification (object)
    • Settings for Streams, including: StreamEnabled (boolean), and StreamViewType (KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, or NEW_AND_OLD_IMAGES)
  • TableClass (string)
    • Class of the table, can be set to: STANDARD, or STANDARD_INFREQUENT_ACCESS
  • Tags (array)
    • Array of pairs to label the table

DeleteBackup

Canonical AWS API doc

Properties:

  • BackupArn (string) [required]
    • ARN of the specified backup

DeleteItem

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • Key (object) [required]
    • Primary (and sort) key of the item in question
  • ConditionalOperator (string)
    • Legacy parameter, use FilterExpression instead
  • ConditionExpression (string)
  • Expected (object)
    • Legacy parameter, use ConditionExpression instead
  • ExpressionAttributeNames (object)
  • ExpressionAttributeValues (object)
  • ReturnConsumedCapacity (string)
    • Return throughput consumption in response, can be set to one of: INDEXES, TOTAL, or NONE
  • ReturnItemCollectionMetrics (string)
    • Return collection metrics in response, can be set to: SIZE, or NONE (default)
  • ReturnValues (string)
    • Return the item as it was prior to the operation taking place, can be set to NONE (default), or ALL_OLD
  • ReturnValuesOnConditionCheckFailure (string)
    • Return the item attributes that failed a condition check, can be set to NONE, or ALL_OLD

DeleteTable

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name

DescribeBackup

Canonical AWS API doc

Properties:

  • BackupArn (string) [required]
    • ARN of the specified backup

DescribeContinuousBackups

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name

DescribeContributorInsights

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • IndexName (string)
    • DynamoDB global secondary index name (if applicable)

DescribeEndpoints

Canonical AWS API doc

Properties:

DescribeExport

Canonical AWS API doc

Properties:

  • ExportArn (string) [required]
    • ARN of the specified export

DescribeGlobalTable

Canonical AWS API doc

Properties:

  • GlobalTableName (string) [required]
    • DynamoDB global table name

DescribeGlobalTableSettings

Canonical AWS API doc

Properties:

  • GlobalTableName (string) [required]
    • DynamoDB global table name

DescribeImport

Canonical AWS API doc

Properties:

  • ImportArn (string) [required]
    • ARN of the specified import

DescribeKinesisStreamingDestination

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name

DescribeLimits

Canonical AWS API doc

Properties:

DescribeTable

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name

DescribeTableReplicaAutoScaling

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name

DescribeTimeToLive

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name

DisableKinesisStreamingDestination

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • StreamArn (string) [required]
    • ARN of the specified Kinesis data stream

EnableKinesisStreamingDestination

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • StreamArn (string) [required]
    • ARN of the specified Kinesis data stream

ExecuteStatement

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • Statement (string) [required]
    • PartiQL statement representing the operation to run
  • ConsistentRead (boolean)
    • Enable strongly consistent reads; by default eventually consistent reads are used
  • Limit (number)
    • Maximum number of items to evaluate and return
  • NextToken (string)
    • Pagination cursor token to be used if NextToken was returned in a previous response
  • Parameters (array)
    • PartiQL statement parameters, if any
  • ReturnConsumedCapacity (string)
    • Return throughput consumption in response, can be set to one of: INDEXES, TOTAL, or NONE
  • ReturnValuesOnConditionCheckFailure (string)
    • Return the item attributes that failed a condition check, can be set to NONE, or ALL_OLD

ExecuteTransaction

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • TransactStatements (array) [required]
    • PartiQL statement parameters representing the transaction to run
  • ClientRequestToken (string)
    • Pagination cursor token to be used if NextToken was returned in a previous response
  • ReturnConsumedCapacity (string)
    • Return throughput consumption in response, can be set to one of: INDEXES, TOTAL, or NONE

ExportTableToPointInTime

Canonical AWS API doc

Properties:

  • S3Bucket (string) [required]
    • Destination S3 bucket of the snapshot export
  • TableArn (string) [required]
    • ARN of the table being exported
  • ClientToken (string)
    • Ensures operation request is idempotent
  • ExportFormat (string)
    • Format for the exported data, can be set to: DYNAMODB_JSON, or IO
  • ExportTime (number)
    • Point in time (in epoch seconds) from which to export table data
  • S3BucketOwner (string)
    • AWS account ID that owns the destination S3 bucket
  • S3Prefix (string)
    • S3 bucket prefix to use as the file name and path of the exported snapshot
  • S3SseAlgorithm (string)
    • Type of encryption used on the bucket where export data will be stored, can be set to AES256, or KMS
  • S3SseKmsKeyId (string)
    • AWS KMS managed key ID used to encrypt the destination S3 bucket (if applicable)

GetItem

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • Key (object) [required]
    • Primary (and sort) key of the item in question
  • AttributesToGet (array)
    • Legacy parameter, use ProjectionExpression instead
  • ConsistentRead (boolean)
    • Enable strongly consistent reads; by default eventually consistent reads are used
  • ExpressionAttributeNames (object)
  • ProjectionExpression (string)
    • Comma separated string that identifies one or more attributes to retrieve from the table
  • ReturnConsumedCapacity (string)
    • Return throughput consumption in response, can be set to one of: INDEXES, TOTAL, or NONE

ImportTable

Canonical AWS API doc

Properties:

  • InputFormat (string) [required]
    • Source data format, can be set to: CSV, DYNAMODB_JSON, or ION
  • S3BucketSource (object) [required]
    • Destination S3 bucket of the snapshot import
  • TableCreationParameters (object) [required]
  • ClientToken (string)
    • Ensures operation request is idempotent
  • InputCompressionType (string)
    • Input compression type, can be set to: GZIP, ZSTD, or NONE
  • InputFormatOptions (object)
    • Additional input formatting options

ListBackups

Canonical AWS API doc

Properties:

  • BackupType (string)
    • Limit backups by type, can be set to: USER SYSTEM, AWS_BACKUP, or ALL
  • ExclusiveStartBackupArn (string)
    • Pagination cursor token ARN to be used if LastEvaluatedBackupArn was returned in a previous response
  • Limit (number)
    • Maximum number of items to evaluate and return
  • TableName (string)
    • List backups by DynamoDB table name
  • TimeRangeLowerBound (number)
    • Inclusively return backups created after this time
  • TimeRangeUpperBound (number)
    • Exclusively return backups created before this time
  • paginate (boolean, string)
    • Enable automatic result pagination; use this instead of making your own individual pagination requests

ListContributorInsights

Canonical AWS API doc

Properties:

  • MaxResults (number)
    • Maximum number of items to evaluate and return
  • NextToken (string)
    • Pagination cursor token to be used if NextToken was returned in a previous response
  • TableName (string)
    • DynamoDB table name

ListExports

Canonical AWS API doc

Properties:

  • MaxResults (number)
    • Maximum number of items to evaluate and return
  • NextToken (string)
    • Pagination cursor token to be used if NextToken was returned in a previous response
  • TableArn (string)
    • ARN of the exported table

ListGlobalTables

Canonical AWS API doc

Properties:

  • ExclusiveStartGlobalTableName (string)
    • Pagination cursor token to be used if LastEvaluatedGlobalTableName was returned in a previous response
  • Limit (number)
    • Maximum number of items to evaluate and return
  • RegionName (string)
    • List the global tables in a specific region

ListImports

Canonical AWS API doc

Properties:

  • NextToken (string)
    • Pagination cursor token to be used if NextToken was returned in a previous response
  • PageSize (number)
    • Maximum number of items to evaluate and return
  • TableArn (string)
    • ARN of the table imported to

ListTables

Canonical AWS API doc

Properties:

  • ExclusiveStartTableName (string)
    • Pagination cursor token to be used if LastEvaluatedTableName was returned in a previous response
  • Limit (number)
    • Maximum number of items to evaluate and return

ListTagsOfResource

Canonical AWS API doc

Properties:

  • NextToken (string)
    • Pagination cursor token to be used if NextToken was returned in a previous response
  • ResourceArn (string) [required]
    • Resource tags to be returned

PutItem

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • Item (object) [required]
    • Item to be written to DynamoDB
  • ConditionalOperator (string)
    • Legacy parameter, use FilterExpression instead
  • ConditionExpression (string)
  • Expected (object)
    • Legacy parameter, use ConditionExpression instead
  • ExpressionAttributeNames (object)
  • ExpressionAttributeValues (object)
  • ReturnConsumedCapacity (string)
    • Return throughput consumption in response, can be set to one of: INDEXES, TOTAL, or NONE
  • ReturnItemCollectionMetrics (string)
    • Return collection metrics in response, can be set to: SIZE, or NONE (default)
  • ReturnValues (string)
    • Return the item as it was prior to the operation taking place, can be set to NONE (default), or ALL_OLD
  • ReturnValuesOnConditionCheckFailure (string)
    • Return the item attributes that failed a condition check, can be set to NONE, or ALL_OLD

Query

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • AttributesToGet (array)
    • Legacy parameter, use ProjectionExpression instead
  • ConditionalOperator (string)
    • Legacy parameter, use FilterExpression instead
  • ConsistentRead (boolean)
    • Enable strongly consistent reads; by default eventually consistent reads are used
  • ExclusiveStartKey (object)
    • Pagination cursor token ARN to be used if LastEvaluatedKey was returned in a previous response
  • ExpressionAttributeNames (object)
  • ExpressionAttributeValues (object)
  • FilterExpression (string)
  • IndexName (string)
    • DynamoDB global secondary index name (if applicable)
  • KeyConditionExpression (string)
    • Condition specifying the key values for items to be retrieved; the condition must perform an equality test on a single partition key value
    • More details (AWS)
  • KeyConditions (object)
    • Legacy parameter, use KeyConditionExpression instead
  • Limit (number)
    • Maximum number of items to evaluate and return
  • ProjectionExpression (string)
    • Comma separated string that identifies one or more attributes to retrieve from the table
  • QueryFilter (object)
    • Legacy parameter, use FilterExpression instead
  • ReturnConsumedCapacity (string)
    • Return throughput consumption in response, can be set to one of: INDEXES, TOTAL, or NONE
  • ScanIndexForward (boolean)
    • Index traversal order: true (default) for ascending, false for descending order
  • Select (string)
    • Attributes to be returned in the result, can be set to: ALL_ATTRIBUTES, ALL_PROJECTED_ATTRIBUTES, COUNT, or SPECIFIC_ATTRIBUTES
    • More details (AWS)
  • paginate (boolean, string)
    • Enable automatic result pagination; use this instead of making your own individual pagination requests

RestoreTableFromBackup

Canonical AWS API doc

Properties:

  • BackupArn (string) [required]
    • ARN of the specified backup
  • TargetTableName (string) [required]
    • Name of the new table into which the backup will be restored
  • BillingModeOverride (string)
    • Set how the table is charged for read/write throughput: PROVISIONED, or PAY_PER_REQUEST
  • GlobalSecondaryIndexOverride (array)
    • List of global secondary indexes for the restored table; included indexes should match existing secondary indexes, although indexes can be excluded
  • LocalSecondaryIndexOverride (array)
    • List of local secondary indexes for the restored table; included indexes should match existing secondary indexes, although indexes can be excluded
  • ProvisionedThroughputOverride (object)
    • Provisioned throughput setting
  • SSESpecificationOverride (object)
    • Server-side encryption settings

RestoreTableToPointInTime

Canonical AWS API doc

Properties:

  • TargetTableName (string) [required]
    • Name of the new table into which the backup will be restored
  • BillingModeOverride (string)
    • Set how the table is charged for read/write throughput: PROVISIONED, or PAY_PER_REQUEST
  • GlobalSecondaryIndexOverride (array)
    • List of global secondary indexes for the restored table; included indexes should match existing secondary indexes, although indexes can be excluded
  • LocalSecondaryIndexOverride (array)
    • List of local secondary indexes for the restored table; included indexes should match existing secondary indexes, although indexes can be excluded
  • ProvisionedThroughputOverride (object)
    • Provisioned throughput setting
  • RestoreDateTime (number)
    • Past time to restore the table to
  • SourceTableArn (string)
    • ARN of the specified backup
  • SourceTableName (string)
    • Name of the source table being restored
  • SSESpecificationOverride (object)
    • Server-side encryption settings
  • UseLatestRestorableTime (boolean)
    • Restore to the latest possible time; typically 5 minutes before the current time

Scan

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • AttributesToGet (array)
    • Legacy parameter, use ProjectionExpression instead
  • ConditionalOperator (string)
    • Legacy parameter, use FilterExpression instead
  • ConsistentRead (boolean)
    • Enable strongly consistent reads; by default eventually consistent reads are used
  • ExclusiveStartKey (object)
    • Pagination cursor token ARN to be used if LastEvaluatedKey was returned in a previous response
  • ExpressionAttributeNames (object)
  • ExpressionAttributeValues (object)
  • FilterExpression (string)
  • IndexName (string)
    • DynamoDB global secondary index name (if applicable)
  • Limit (number)
    • Maximum number of items to evaluate and return
  • ProjectionExpression (string)
    • Comma separated string that identifies one or more attributes to retrieve from the table
  • ReturnConsumedCapacity (string)
    • Return throughput consumption in response, can be set to one of: INDEXES, TOTAL, or NONE
  • ScanFilter (object)
    • Legacy parameter, use FilterExpression instead
  • Segment (number)
  • Select (string)
    • Attributes to be returned in the result, can be set to: ALL_ATTRIBUTES, ALL_PROJECTED_ATTRIBUTES, COUNT, or SPECIFIC_ATTRIBUTES
    • More details (AWS)
  • TotalSegments (number)
  • paginate (boolean, string)
    • Enable automatic result pagination; use this instead of making your own individual pagination requests

TagResource

Canonical AWS API doc

Properties:

  • ResourceArn (string) [required]
    • Resource to add tags to
  • Tags (array) [required]
    • Tags to be assigned

TransactGetItems

Canonical AWS API doc

Properties:

  • TransactItems (array) [required]
    • Ordered array of up to 100 TransactGetItem objects, each of which containing a Get object
    • More details (AWS)
  • ReturnConsumedCapacity (string)
    • Return throughput consumption in response, can be set to one of: INDEXES, TOTAL, or NONE

TransactWriteItems

Canonical AWS API doc

Properties:

  • TransactItems (array) [required]
    • Ordered array of up to 100 TransactWriteItem objects, each of which containing a ConditionCheck, Put, Update, or Delete object
    • More details (AWS)
  • ClientRequestToken (string)
    • Ensures operation request is idempotent
  • ReturnConsumedCapacity (string)
    • Return throughput consumption in response, can be set to one of: INDEXES, TOTAL, or NONE
  • ReturnItemCollectionMetrics (string)
    • Return collection metrics in response, can be set to: SIZE, or NONE (default)

UntagResource

Canonical AWS API doc

Properties:

  • ResourceArn (string) [required]
    • Resource to remove tags from
  • TagKeys (array) [required]
    • Tags to be removed

UpdateContinuousBackups

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • PointInTimeRecoverySpecification (object)

UpdateContributorInsights

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • ContributorInsightsAction (string)
    • Contributor insights action, can be set to: ENABLE or DISABLE
  • IndexName (string)
    • DynamoDB global secondary index name (if applicable)

UpdateGlobalTable

Canonical AWS API doc

Properties:

  • GlobalTableName (string) [required]
    • DynamoDB global table name
  • ReplicaUpdates (array)
    • List of regions to be added or removed from the global table

UpdateGlobalTableSettings

Canonical AWS API doc

Properties:

  • GlobalTableName (string) [required]
    • DynamoDB global table name
  • GlobalTableBillingMode (string)
    • Set how the table is charged for read/write throughput: PROVISIONED, or PAY_PER_REQUEST
  • GlobalTableGlobalSecondaryIndexSettingsUpdate (array)
  • GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate (object)
  • GlobalTableProvisionedWriteCapacityUnits (number)
    • Maximum number of writes per second before returning a ThrottlingException
  • ReplicaSettingsUpdate (array)

UpdateItem

Canonical AWS API doc

Properties:

  • Key (object) [required]
    • Primary (and sort) key of the item in question
  • TableName (string) [required]
    • DynamoDB table name
  • AttributeUpdates (object)
    • Legacy parameter, use UpdateExpression instead
  • ConditionalOperator (string)
    • Legacy parameter, use ConditionExpression instead
  • ConditionExpression (string)
  • Expected (object)
    • Legacy parameter, use ConditionExpression instead
  • ExpressionAttributeNames (object)
  • ExpressionAttributeValues (object)
  • ReturnConsumedCapacity (string)
    • Return throughput consumption in response, can be set to one of: INDEXES, TOTAL, or NONE
  • ReturnItemCollectionMetrics (string)
    • Return collection metrics in response, can be set to: SIZE, or NONE (default)
  • ReturnValues (string)
    • Return the item as it was prior to the operation taking place, can be set to NONE (default), ALL_OLD, UPDATED_OLD, ALL_NEW, UPDATED_NEW
  • ReturnValuesOnConditionCheckFailure (string)
    • Return the item attributes that failed a condition check, can be set to NONE, or ALL_OLD
  • UpdateExpression (string)
    • Expression that defines attributes to be updated, the action to be performed on each, and their new values
    • More details (AWS)

UpdateTable

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • AttributeDefinitions (array)
    • Array of attributes that describe the primary (and sort) schema for the table
  • BillingMode (string)
    • Set how the table is charged for read/write throughput: PROVISIONED, or PAY_PER_REQUEST
  • DeletionProtectionEnabled (boolean)
    • Enable or disable deletion protection
  • GlobalSecondaryIndexUpdates (array)
    • Global secondary index updates, each of which may be: Create, Update, or Delete
    • More details (AWS)
  • ProvisionedThroughput (object)
    • Provisioned throughput setting
  • ReplicaUpdates (array)
    • Table replica updates, each of which may be: Create, Update, or Delete
    • More details (AWS)
  • SSESpecification (object)
    • Server-side encryption settings
  • StreamSpecification (object)
    • Settings for Streams, including: StreamEnabled (boolean), and StreamViewType (KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, or NEW_AND_OLD_IMAGES)
  • TableClass (string)
    • Class of the table, can be set to: STANDARD, or STANDARD_INFREQUENT_ACCESS

UpdateTableReplicaAutoScaling

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • GlobalSecondaryIndexUpdates (array)
  • ProvisionedWriteCapacityAutoScalingUpdate (object)
  • ReplicaUpdates (array)

UpdateTimeToLive

Canonical AWS API doc

Properties:

  • TableName (string) [required]
    • DynamoDB table name
  • TimeToLiveSpecification (object)
    • TTL settings for the specified table

Usage

This plugin covers all DynamoDB methods (listed & linked below), utilizing DynamoDB's semantics.

By default, with the exception of certain legacy properties (noted below), this plugin will automatically (de)serialize AWS-flavored JSON in requests and responses, so you do not have to treat that as a concern.

Legacy properties (which DynamoDB discourages the use of) that will not be automatically (de)serialized: DeleteItem.Expected, PutItem.Expected, Query.KeyConditions, Query.QueryFilter, Scan.ScanFilter, UpdateItem.Expected

Example

import awsLite from '@aws-lite/client'
const aws = await awsLite()

// See: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html
await aws.dynamodb.PutItem({
  TableName: 'your-table-name',
  Item: { id: 'hello', ts: new Date().toISOString() }
})

DynamoDB methods

Learn more

版本与发布记录

@aws-lite/dynamodb 共发布 18 个版本,首次发布于 2023/09/21;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.3.9latest2024/12/241.9 年前
0.3.82024/08/022 年前
0.3.72024/08/012 年前
0.3.62024/08/012 年前
0.3.52024/06/112 年前
0.3.42024/02/072 年前

关于 @aws-lite/dynamodb 的常见问题

@aws-lite/dynamodb 是什么?

Official aws-lite plugin for DynamoDB

如何安装 @aws-lite/dynamodb?

在项目目录运行 npm install @aws-lite/dynamodb,或使用 pnpm add / yarn add / bun add。

@aws-lite/dynamodb 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/aws-lite__dynamodb 是否存在。

@aws-lite/dynamodb 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@aws-lite/dynamodb 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=16。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@aws-lite/dynamodb 可以商用吗?

@aws-lite/dynamodb 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@aws-lite/dynamodb 的下载量有多少?

根据 npm 官方下载统计,@aws-lite/dynamodb 在 2026/10/08 – 2026/11/06 这 30 天内被下载 223,402 次,日均约 7,447 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@aws-lite/dynamodb 还在维护吗?

最新版本 0.3.9 发布于 2024/12/24(1.9 年前);至今共发布 18 个版本,其中过去 12 个月发布了 0 个;首次发布于 2023/09/21。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。