簡體   English   中英

Dynamodb:無法訪問嵌套對象和對象數組

[英]Dynamodb: unable to access nested objects and array of objects

我是DynamoDb的新手。 我試圖訪問數組內的對象:

在表格中創建了一個新項目-

survey.create({
      survey_name: 'Cycle',
      description: 'Describe me',
      test:[{
        title:'hello1'
      },{
        title:'hello2'
      }]
      }, function (err, survey) {
         if(err){
          console.log(err)
        }else{
          console.log('created', survey.get('survey_name'));
        }
      });

我無法獲取“ test [n] .title”,得到0個結果。

survey.query('Cycle')
     .filter('test.title').equals('hello2') //Tried it with test[0].title also
     .exec((err,data)=>{
         if(err){
              console.log(err);
            }
            else{
              console.log(data);
            }
          });

另外,我想檢索表的項目的一部分(json)即。 如果可能的話“測試”

使用過濾器查詢DynamoDB時,需要將要過濾的鍵作為top level鍵。 您不能使用嵌套對象鍵進行過濾。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM