如何在 dynamoDB 上查询嵌套 属性

How to query nested property on dynamo DB

我的数据结构如下。我想检索所有具有 subjectName PHYSICS PAPER-I 和 marksGained 40 的记录。

是否可以查询到这样的记录?我们可以使用任何其他库来实现这一目标吗?

{
  "CID": "A1",
  "COL_ID": "HARISHFYSX",
  "district": "ADILABAD",
  "grandresult": "C",
  "grandtotal": "232",
  "stdntname": "JAMES",
  "subjects": [
    {
      "marksGained": "38",
      "outcome": "P",
      "passType": "*",
      "subjectName": "ENGLISH PAPER -I"
    },
    {
      "marksGained": "56",
      "outcome": "P",
      "passType": "*",
      "subjectName": "TELUGU PAPER-I"
    },
    {
      "marksGained": "42",
      "outcome": "P",
      "passType": "*",
      "subjectName": "BOTANY PAPER-I"
    },
    {
      "marksGained": "22",
      "outcome": "P",
      "passType": "*",
      "subjectName": "ZOOLOGY PAPER-I"
    },
    {
      "marksGained": "40",
      "outcome": "P",
      "passType": "*",
      "subjectName": "PHYSICS PAPER-I"
    },
    {
      "marksGained": "34",
      "outcome": "P",
      "passType": null,
      "subjectName": "CHEMISTRY PAPER-I"
    }
  ],
  "ticket": "1534343434",
  "UID": "A1_1534343434"
}

您不能查询嵌套对象,它将是扫描。下面论坛详细讨论,

https://forums.aws.amazon.com/thread.jspa?threadID=164470

希望对您有所帮助。