

# 适用于使用 Amazon SDK 的 DynamoDB 的代码示例
<a name="service_code_examples"></a>

以下代码示例演示如何将 DynamoDB 与 Amazon 软件开发工具包（SDK）一起使用。

*基本功能*是向您展示如何在服务中执行基本操作的代码示例。

*操作*是大型程序的代码摘录，必须在上下文中运行。您可以通过操作了解如何调用单个服务函数，还可以通过函数相关场景的上下文查看操作。

*场景*是向您展示如何通过在一个服务中调用多个函数或与其他 Amazon Web Services 服务 服务结合来完成特定任务的代码示例。

*Amazon 社区贡献*就是由整个 Amazon 的多个团队创建和维护的示例。要提供反馈，请使用链接存储库中提供的机制。

有关 Amazon SDK 开发人员指南和代码示例的完整列表，请参阅 [结合使用 DynamoDB 与 Amazon SDK](sdk-general-information-section.md) 本主题还包括有关入门的信息以及有关先前的 SDK 版本的详细信息。

**Contents**
+ [基本功能](service_code_examples_basics.md)
  + [开始使用 DynamoDB](example_dynamodb_Hello_section.md)
  + [了解基本功能](example_dynamodb_Scenario_GettingStartedMovies_section.md)
  + [操作](service_code_examples_actions.md)
    + [`BatchExecuteStatement`](example_dynamodb_BatchExecuteStatement_section.md)
    + [`BatchGetItem`](example_dynamodb_BatchGetItem_section.md)
    + [`BatchWriteItem`](example_dynamodb_BatchWriteItem_section.md)
    + [`CreateTable`](example_dynamodb_CreateTable_section.md)
    + [`DeleteItem`](example_dynamodb_DeleteItem_section.md)
    + [`DeleteTable`](example_dynamodb_DeleteTable_section.md)
    + [`DescribeTable`](example_dynamodb_DescribeTable_section.md)
    + [`DescribeTimeToLive`](example_dynamodb_DescribeTimeToLive_section.md)
    + [`ExecuteStatement`](example_dynamodb_ExecuteStatement_section.md)
    + [`GetItem`](example_dynamodb_GetItem_section.md)
    + [`ListTables`](example_dynamodb_ListTables_section.md)
    + [`PutItem`](example_dynamodb_PutItem_section.md)
    + [`Query`](example_dynamodb_Query_section.md)
    + [`Scan`](example_dynamodb_Scan_section.md)
    + [`UpdateItem`](example_dynamodb_UpdateItem_section.md)
    + [`UpdateTable`](example_dynamodb_UpdateTable_section.md)
    + [`UpdateTimeToLive`](example_dynamodb_UpdateTimeToLive_section.md)
+ [场景](service_code_examples_scenarios.md)
  + [借助 DAX 加快读取速度](example_dynamodb_Usage_DaxDemo_section.md)
  + [高级全局二级索引方案](example_dynamodb_Scenario_GSIAdvanced_section.md)
  + [构建应用程序以将数据提交到 DynamoDB 表](example_cross_SubmitDataApp_section.md)
  + [将多个值与单个属性进行比较](example_dynamodb_Scenario_CompareMultipleValues_section.md)
  + [有条件地更新项目的 TTL](example_dynamodb_UpdateItemConditionalTTL_section.md)
  + [连接到本地实例](example_dynamodb_local_section.md)
  + [对表达式运算符进行计数](example_dynamodb_Scenario_ExpressionOperatorCounting_section.md)
  + [创建 REST API 以跟踪 COVID-19 数据](example_cross_ApiGatewayDataTracker_section.md)
  + [创建 Messenger 应用程序](example_cross_StepFunctionsMessenger_section.md)
  + [创建无服务器应用程序来管理照片](example_cross_PAM_section.md)
  + [创建带有全局二级索引的表](example_dynamodb_CreateTableWithGlobalSecondaryIndex_section.md)
  + [创建启用了热吞吐量的表](example_dynamodb_CreateTableWarmThroughput_section.md)
  + [创建 Web 应用程序来跟踪 DynamoDB 数据](example_cross_DynamoDBDataTracker_section.md)
  + [创建 Websocket 聊天应用程序](example_cross_ApiGatewayWebsocketChat_section.md)
  + [创建设置了 TTL 的项目](example_dynamodb_PutItemTTL_section.md)
  + [创建和管理 MRSC 全局表](example_dynamodb_Scenario_MRSCGlobalTables_section.md)
  + [创建和管理用于演示 MREC 的全局表](example_dynamodb_Scenario_GlobalTableOperations_section.md)
  + [使用 PartiQL DELETE 删除数据](example_dynamodb_PartiQLDelete_section.md)
  + [检测图像中的 PPE](example_cross_RekognitionPhotoAnalyzerPPE_section.md)
  + [使用 PartiQL INSERT 插入数据](example_dynamodb_PartiQLInsert_section.md)
  + [从浏览器调用 Lambda 函数](example_cross_LambdaForBrowser_section.md)
  + [管理全局二级索引](example_dynamodb_Scenario_GSILifecycle_section.md)
  + [管理基于资源的策略](example_dynamodb_Scenario_ResourcePolicyLifecycle_section.md)
  + [监控 DynamoDB 性能](example_cross_MonitorDynamoDB_section.md)
  + [执行高级查询操作](example_dynamodb_Scenario_AdvancedQueryTechniques_section.md)
  + [执行列表操作](example_dynamodb_Scenario_ListOperations_section.md)
  + [执行映射操作](example_dynamodb_Scenario_MapOperations_section.md)
  + [执行设置操作](example_dynamodb_Scenario_SetOperations_section.md)
  + [使用批量 PartIQL 语句查询表](example_dynamodb_Scenario_PartiQLBatch_section.md)
  + [使用 PartiQL 查询表](example_dynamodb_Scenario_PartiQLSingle_section.md)
  + [使用全局二级索引查询表](example_dynamodb_Scenarios_QueryWithGlobalSecondaryIndex_section.md)
  + [使用 begins\$1with 条件查询表](example_dynamodb_Scenarios_QueryWithBeginsWithCondition_section.md)
  + [使用日期范围查询表](example_dynamodb_Scenarios_QueryWithDateRange_section.md)
  + [使用复杂的筛选表达式查询表](example_dynamodb_Scenarios_QueryWithComplexFilter_section.md)
  + [使用动态筛选表达式查询表](example_dynamodb_Scenarios_QueryWithDynamicFilter_section.md)
  + [使用筛选表达式和限制查询表](example_dynamodb_Scenarios_QueryWithFilterAndLimit_section.md)
  + [使用嵌套属性查询表](example_dynamodb_Scenarios_QueryWithNestedAttributes_section.md)
  + [通过分区查询表](example_dynamodb_Scenarios_QueryWithPagination_section.md)
  + [通过强一致性读取查询表](example_dynamodb_Scenarios_QueryWithStronglyConsistentReads_section.md)
  + [使用 PartiQL SELECT 查询数据](example_dynamodb_PartiQLSelect_section.md)
  + [查询 TTL 项目](example_dynamodb_QueryFilteredTTL_section.md)
  + [使用日期和时间模式查询表](example_dynamodb_Scenario_DateTimeQueries_section.md)
  + [保存 EXIF 和其他图像信息](example_cross_DetectLabels_section.md)
  + [设置基于属性的访问控制](example_dynamodb_Scenario_ABACSetup_section.md)
  + [了解更新表达式顺序](example_dynamodb_Scenario_UpdateExpressionOrder_section.md)
  + [更新表的热吞吐量设置](example_dynamodb_UpdateTableWarmThroughput_section.md)
  + [更新项目的 TTL](example_dynamodb_UpdateItemTTL_section.md)
  + [使用 PartiQL UPDATE 更新数据](example_dynamodb_PartiQLUpdate_section.md)
  + [使用 API Gateway 调用 Lambda 函数](example_cross_LambdaAPIGateway_section.md)
  + [使用 Step Functions 调用 Lambda 函数](example_cross_ServerlessWorkflows_section.md)
  + [使用文档模型](example_dynamodb_MidLevelInterface_section.md)
  + [使用高级对象持久化模型](example_dynamodb_HighLevelInterface_section.md)
  + [使用原子计数器操作](example_dynamodb_Scenario_AtomicCounterOperations_section.md)
  + [使用条件运算](example_dynamodb_Scenario_ConditionalOperations_section.md)
  + [使用表达式属性名称](example_dynamodb_Scenario_ExpressionAttributeNames_section.md)
  + [使用计划的事件调用 Lambda 函数](example_cross_LambdaScheduledEvents_section.md)
  + [处理本地二级索引](example_dynamodb_Scenario_LSIExamples_section.md)
  + [处理 Streams 和生存时间](example_dynamodb_Scenario_StreamsAndTTL_section.md)
  + [使用全局表和多区域复制最终一致性（MREC）](example_dynamodb_Scenario_MultiRegionReplication_section.md)
  + [使用资源标记](example_dynamodb_Scenario_TaggingExamples_section.md)
  + [处理表加密](example_dynamodb_Scenario_EncryptionExamples_section.md)
+ [无服务器示例](service_code_examples_serverless_examples.md)
  + [通过 DynamoDB 触发器调用 Lambda 函数](example_serverless_DynamoDB_Lambda_section.md)
  + [通过 DynamoDB 触发器报告 Lambda 函数批处理项目失败](example_serverless_DynamoDB_Lambda_batch_item_failures_section.md)
+ [Amazon 社区贡献](service_code_examples_aws_community_contributions.md)
  + [构建和测试无服务器应用程序](example_tributary-lite_serverless-application_section.md)