Cloud Firestore collection count

后端 未结 17 1527
庸人自扰
庸人自扰 2020-11-22 09:25

Is it possible to count how many items a collection has using the new Firebase database, Cloud Firestore?

If so, how do I do that?

17条回答
  •  [愿得一人]
    2020-11-22 09:47

    var variable=0
    variable=variable+querySnapshot.count
    

    then if you are to use it on a String variable then

    let stringVariable= String(variable)
    

提交回复
热议问题