Firestore REST API: Query parameters type of object

前端 未结 2 623
情歌与酒
情歌与酒 2021-01-18 05:54

I am looking for an advice regarding Google Firestore REST API

I am trying to update the document but keep the data that are not updated (https://cloud.google.com/f

相关标签:
2条回答
  • 2021-01-18 06:04

    Each patched field needs to be included as an individual parameter in the query string:

    https://firestore.googleapis.com/v1beta1/projects/<YOUR PROJECT>/databases/(default)/documents/messages/someid?updateMask.fieldPaths=message&updateMask.fieldPaths=<another_field_to_update>&updateMask.fieldPaths=<and_so_on>
    

    Fields omitted from the field mask are unchanged, regardless if they are included in the request body Document.

    0 讨论(0)
  • 2021-01-18 06:14

    Each patched field needs to be included as an individual parameter in the query string.
    You can use this format for your url :

    https://firestore.googleapis.com/v1beta1/projects/<YOUR PROJECT>/databases/(default)/documents/messages/someid?updateMask.fieldPaths=message&updateMask.fieldPaths=<another_field_to_update>&updateMask.fieldPaths=<and_so_on>
    

    Fields omitted from the field mask are unchanged, regardless if they are included in the request body Document.

    You can use the Google REST API explorer to generate pre-defined URL with Query Parameters and Body from us user friendly interface:

    https://developers.google.com/apis-explorer/

    0 讨论(0)
提交回复
热议问题