【问题标题】:how to get the field name of the forms section that I have in firestore to run a json request如何获取我在firestore中运行json请求的表单部分的字段名称
【发布时间】:2019-07-02 02:36:24
【问题描述】:

我正在与 zapier.com 合作,在 firestore 集合和谷歌文档之间建立联系,有一部分是用来制作 StructuredQuery,我得到 400 错误,因为他似乎没有找到该字段

我多次尝试更改语法,但似乎不起作用

JSON 部分:

{
 "orderBy": [{
        "id": {
         "fieldPath": "title"
        },
        "direction": "DESCENDING"
    }]
}

它发给我这个:

We had trouble finding a sample.
Error code 400: [{

  "error": {
    "code": 400,
    "message": "Invalid JSON payload received. Unknown name \"id\" at 'structured_query.order_by[0]': Cannot find field.",
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.BadRequest",
        "fieldViolations": [
          {
            "field": "structured_query.order_by[0]",
            "description": "Invalid JSON payload received. Unknown name \"id\" at 'structured_query.order_by[0]': Cannot find field."
          }
        ]
      }
    ]
  }
}
]    

the firebase part that i try to reach

【问题讨论】:

    标签: json google-cloud-firestore zapier


    【解决方案1】:

    为任何认为有帮助的人提供解决方案

    {
     "orderBy": [{
             "field": {    
                        "fieldPath": "id"
                    },
            "direction": "DESCENDING"
        }]
    }
    

    【讨论】:

      【解决方案2】:

      试试这个

      {
        "orderBy": [
          {
            "field": {
              "fieldPath": "name" //name is the field in you document.
            },
            "direction": "DESCENDING"
          }
        ]
      }
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-09-02
        • 2017-04-13
        • 2013-07-23
        • 1970-01-01
        • 2019-12-29
        • 1970-01-01
        相关资源
        最近更新 更多