【问题标题】:What is the best way to save data with HTML tags in DynamoDB?在 DynamoDB 中使用 HTML 标签保存数据的最佳方式是什么?
【发布时间】:2018-04-06 00:50:08
【问题描述】:

我正在使用 DynamoDB 在前端存储表单中的数据,我的数据对象如下所示。

{
"data": {
    "id": "uuid1",
    "content": "<h1>Title</h1><p>This is content</p>"
  }
}

我不确定&lt;h1&gt;Title&lt;/h1&gt;&lt;p&gt;This is content&lt;/p&gt; 是否是使用 HTML 标签保存字符串的最佳方式。

将&lt;h1&gt;Title&lt;/h1&gt;&lt;p&gt;This is content&lt;/p&gt; 保存到 DynamoDB 并在前端显示正确呈现 HTML 标记的最佳方式是什么?

【问题讨论】:

    标签: json amazon-dynamodb


    【解决方案1】:

    https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html

    字符串

    字符串是带有 UTF-8 二进制编码的 Unicode。字符串的长度 必须大于零并受最大 DynamoDB 约束 项目大小限制为 400 KB。

    由于您的所有标签都与 UTF-8 兼容,因此您无需进行任何特殊编码。

    【讨论】:

      猜你喜欢
      • 2011-08-28
      • 2010-10-05
      • 2022-11-29
      • 2021-10-22
      • 1970-01-01
      • 2019-02-01
      • 2018-06-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多