Firestore get DocumentSnapshot's field's value

后端 未结 5 580
盖世英雄少女心
盖世英雄少女心 2021-02-02 09:10

If I have a Firebase Firestore database which I have retrieved a DocumentSnapshot for the document corresponding to the collection on the right and stored in a

5条回答
  •  余生分开走
    2021-02-02 09:47

    Here is another simple way to get document value(in your case):

    Firestore.instance
    .collection('users').document('xsajAansjdna')
    .get()
    .then((value) =>
    print("Fetched ==>>>"+value.data["username"]));
    

提交回复
热议问题