Adding an Object to Cloud Firestore using Flutter

后端 未结 3 1089
余生分开走
余生分开走 2021-01-02 06:44

I want to add an object to Google Cloud Firestore in my Flutter app like this:

\"Firestore

I ha

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-02 07:05

    @Laksh22 As far as I understand, you mean something like this:

    Firestore.instance.runTransaction((transaction) async {
        await transaction.set(Firestore.instance.collection("your_collection").document(), {
            'reply' : {
            'replyName': replyName,
            'replyText': replyText,
            'replyVotes': replyVotes,
        }
    });
    

    just like the screenshot above.

提交回复
热议问题