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

后端 未结 3 1157
广开言路
广开言路 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:18

    Just adding to Doug Stevenson's answer, I had to use the key isGreaterThan: '' in order to not get an empty array.

    Firestore.instance
        .collection('posts')
        .where('userlist.' + userId, isGreaterThan: '')
        .snapshots(),
    

提交回复
热议问题