Query a Map containing an ID saved in Cloud Firestore with Dart/Flutter

后端 未结 3 1148
广开言路
广开言路 2021-01-26 12:45

How to get a Map stored in Cloud Firestore with Dart/Flutter ? I tried this but it only works with Array :

Firestore.instance
            .collection(\'posts\')
          


        
3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-26 13:34

    I don't recommend your way of data model. Because of some limitations as below:

    1. You can only have 20000 fields in a firestore document (including array fields).
    2. You can't assign security rules to each field. Security Rules is a thing that you have to think of.
    3. You can't query them.

    So, better I would recommend you to use documents for each user.

提交回复
热议问题