有没有办法获取给定数据库的列表长度?

Is there a way to get the list length for a given database?

我可以使用 https://api.notion.com/v1/databases/:id/query 获取给定数据库的 children 的分页列表。但是我可以在任何地方获得 children 的当前数量吗?

如果要数据库中的页数(子),假设是javascript。

<!DOCTYPE html>
<html>

<body>

  <p>Click the button to create an array, then display its length.</p>

  <button onclick="myFunction()">Find Length</button>

  <p id="demo"></p>

  <script>
    function myFunction() {
      var data = {
        "object": "list",
        "results": [{
            "object": "page",
            "id": "2e01e904-febd-43a0-ad02-8eedb903a82c",
            "created_time": "2020-03-17T19:10:04.968Z",
            "last_edited_time": "2020-03-17T21:49:37.913Z",
            "parent": {
              "type": "database_id",
              "database_id": "897e5a76-ae52-4b48-9fdf-e71f5945d1af"
            },
            "archived": false,
            "properties": {
              "Recipes": {
                "id": "Ai`L",
                "type": "relation",
                "relation": [{
                    "id": "796659b4-a5d9-4c64-a539-06ac5292779e"
                  },
                  {
                    "id": "79e63318-f85a-4909-aceb-96a724d1021c"
                  }
                ]
              },
              "Cost of next trip": {
                "id": "R}wl",
                "type": "formula",
                "formula": {
                  "type": "number",
                  "number": 2
                }
              },
              "Last ordered": {
                "id": "UsKi",
                "type": "date",
                "date": {
                  "start": "2020-10-07",
                  "end": null
                }
              },
              "In stock": {
                "id": "{>U;",
                "type": "checkbox",
                "checkbox": false
              }
            }
          },
          {
            "object": "page",
            "id": "2e01e904-febd-43a0-ad02-8eedb903a82c",
            "created_time": "2020-03-17T19:10:04.968Z",
            "last_edited_time": "2020-03-17T21:49:37.913Z",
            "parent": {
              "type": "database_id",
              "database_id": "897e5a76-ae52-4b48-9fdf-e71f5945d1af"
            },
            "archived": false,
            "properties": {
              "Recipes": {
                "id": "Ai`L",
                "type": "relation",
                "relation": [{
                    "id": "796659b4-a5d9-4c64-a539-06ac5292779e"
                  },
                  {
                    "id": "79e63318-f85a-4909-aceb-96a724d1021c"
                  }
                ]
              },
              "Cost of next trip": {
                "id": "R}wl",
                "type": "formula",
                "formula": {
                  "type": "number",
                  "number": 2
                }
              },
              "Last ordered": {
                "id": "UsKi",
                "type": "date",
                "date": {
                  "start": "2020-10-07",
                  "end": null
                }
              },
              "In stock": {
                "id": "{>U;",
                "type": "checkbox",
                "checkbox": false
              }
            }
          }
        ],
        "has_more": false,
        "next_cursor": null
      }
      document.getElementById("demo").innerHTML = data.results.length;
    }
  </script>

</body>

</html>

API当前版本API(概念版本:2021-05-13)中没有提供结果计数。