<small id='17CJV'></small><noframes id='17CJV'>

      • <bdo id='17CJV'></bdo><ul id='17CJV'></ul>
      <tfoot id='17CJV'></tfoot>
    1. <legend id='17CJV'><style id='17CJV'><dir id='17CJV'><q id='17CJV'></q></dir></style></legend>
      1. <i id='17CJV'><tr id='17CJV'><dt id='17CJV'><q id='17CJV'><span id='17CJV'><b id='17CJV'><form id='17CJV'><ins id='17CJV'></ins><ul id='17CJV'></ul><sub id='17CJV'></sub></form><legend id='17CJV'></legend><bdo id='17CJV'><pre id='17CJV'><center id='17CJV'></center></pre></bdo></b><th id='17CJV'></th></span></q></dt></tr></i><div id='17CJV'><tfoot id='17CJV'></tfoot><dl id='17CJV'><fieldset id='17CJV'></fieldset></dl></div>

        DynamoDB 查询 JSON 对象的子字段

        时间:2023-09-29

        <tfoot id='x4Aze'></tfoot>
          <tbody id='x4Aze'></tbody>
          <legend id='x4Aze'><style id='x4Aze'><dir id='x4Aze'><q id='x4Aze'></q></dir></style></legend>
          <i id='x4Aze'><tr id='x4Aze'><dt id='x4Aze'><q id='x4Aze'><span id='x4Aze'><b id='x4Aze'><form id='x4Aze'><ins id='x4Aze'></ins><ul id='x4Aze'></ul><sub id='x4Aze'></sub></form><legend id='x4Aze'></legend><bdo id='x4Aze'><pre id='x4Aze'><center id='x4Aze'></center></pre></bdo></b><th id='x4Aze'></th></span></q></dt></tr></i><div id='x4Aze'><tfoot id='x4Aze'></tfoot><dl id='x4Aze'><fieldset id='x4Aze'></fieldset></dl></div>
          • <small id='x4Aze'></small><noframes id='x4Aze'>

              <bdo id='x4Aze'></bdo><ul id='x4Aze'></ul>
                • 本文介绍了DynamoDB 查询 JSON 对象的子字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  是否可以在dynamoDB表中搜索json对象的子字段?

                  Is it possible to search for a subfield of a json object in dynamoDB table?

                  我的桌子:

                  Item: "item name",  
                  Location: {...},  
                  ItemInformation :  
                  {  
                     ItemName: "itemName",  
                     ProductLine: {  
                        Brand: "Razer",  
                        ManufacturerSource: "Razer"  
                  }
                  

                  原来在这个表中ItemInformation是一个key,搜索一个对象,我们会为item信息构造json,然后用json字符串作为key进行查询.现在我们需要实现按该对象的子字段搜索,每次可以包含不同的字段,即isDigital: "true".

                  Originally in this table ItemInformation would be a key and searching for an object we would construct the json for the item information and then query with the json string as a key.. Now we need to implement searching by sub fields of that object, which can contain different fields each time, i.e. isDigital: "true".

                  我在问题中注意到:DynamoDB 高级扫描 - JAVA

                  答案似乎是否定的,我必须将字段分开.但我很好奇 PHP 库为什么以及如何在 dynamoDB 中查询 JSON 对象上的子字段.真的没有更好的解决方案,然后将列存储为单独的字段,然后在所有字段上添加索引?

                  The answer would seem to be no and I would have to separate out the fields. But I am curious about why and how the PHP library can query for sub fields on a JSON object in dynamoDB. Is there really no better solution then to store the column as separate fields and then add an index on all fields?

                  推荐答案

                  查看文档后,按照我最初的意图实现搜索字段是不可行的.问题是,虽然值是 JSON,但它们存储为字符串文字,所以我必须进行重构才能开始存储为 JSON 对象.此外,我无法添加列和索引,因为搜索可以对任意数量的字段进行操作,并且不同的项目可以有不同的字段,即项目可以有品牌、电池信息、名称.鉴于要求是这些子字段中的任何一个都应该是可搜索的,因此最好在 Cloud Search 或 ElasticSearch 中执行此操作,我可以在对象的列中对任意字段和值进行索引和搜索.

                  After looking through documentation it is not feasible to implement the search fields as I originally intended. The problem is that while the values are JSON they are stored as string literals so I have to do refactoring to start storing as JSON objects. Additionally I cannot add in columns and index because the search could operate on any number of fields and different items can have different fields, i.e. an Item can have Brand, BatteryInformation, Name. Given that the requirement is that any of these subfields should be searchable its better to do this in Cloud Search or ElasticSearch where I can index and search on arbitrary fields and values within a column of an object.

                  由于这是一个 DynamoDB 表,我将使用 CloudSearch,因为它提供了更简单的索引选项和数据集成.

                  Since this is a DynamoDB table, I am going to use CloudSearch since it offers easier indexing option and integration for data.

                  这篇关于DynamoDB 查询 JSON 对象的子字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:简单的 DynamoDB 请求失败并出现 ResourceNotFoundExce 下一篇:使用 java sdk 从具有哈希范围模式的给定哈希键查

                  相关文章

                  最新文章

                  <i id='DCEZP'><tr id='DCEZP'><dt id='DCEZP'><q id='DCEZP'><span id='DCEZP'><b id='DCEZP'><form id='DCEZP'><ins id='DCEZP'></ins><ul id='DCEZP'></ul><sub id='DCEZP'></sub></form><legend id='DCEZP'></legend><bdo id='DCEZP'><pre id='DCEZP'><center id='DCEZP'></center></pre></bdo></b><th id='DCEZP'></th></span></q></dt></tr></i><div id='DCEZP'><tfoot id='DCEZP'></tfoot><dl id='DCEZP'><fieldset id='DCEZP'></fieldset></dl></div>

                  <tfoot id='DCEZP'></tfoot>
                    <legend id='DCEZP'><style id='DCEZP'><dir id='DCEZP'><q id='DCEZP'></q></dir></style></legend>

                      <small id='DCEZP'></small><noframes id='DCEZP'>

                        <bdo id='DCEZP'></bdo><ul id='DCEZP'></ul>