代码之家  ›  专栏  ›  技术社区  ›  tr1via

Firestore数据库查询问题

  •  0
  • tr1via  · 技术社区  · 2 年前

    如果 user_id 是“BED3wChei4NEiDfQP72atUz2NU43” 我如何才能执行相同的操作。

    Firestore screenshot

    1 回复  |  直到 2 年前
        1
  •  2
  •   Or Nakash    2 年前

    您可以使用以下方法:

    FirebaseFirestore.instance
      .collection('password_entries')
      .where('user_id ', isEqualTo: "BED3wChei4NEiDfQP72atUz2NU43")
      .get()
      .then((checkSnapshot) {
        // Document found - do something with it
        print(checkSnapshot.docs[0].data());
      });