How to check if the field exists in firestore?

前端 未结 2 1230
长发绾君心
长发绾君心 2021-01-23 01:16

I am checking whether the Boolean field called attending exists, however I am not sure how to do that.

Is there a function such as .child().exists()<

2条回答
  •  暖寄归人
    2021-01-23 01:32

    What you're doing now is correct - you have to read the document and examine the snapshot to see if the field exists. There is no shorter way to do this.

提交回复
热议问题