如何从扑扑的云Firestore中检索数据?

时间:2019-01-21 10:50:15

标签: flutter

我们正试图从Cloud Firestore中获取数据,但是我们无法找到管理员如何获取有关用户的所有信息(如约会)

enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

希望您正在使用插件cloud_firestore从Firestore中获取数据

使用您的凭据初始化Firestore,可以从您的google_services.json文件复制该凭据

{libraryName}.js

获取文档

final FirebaseApp app = await FirebaseApp.configure(
    name: 'test',
    options: const FirebaseOptions(
      googleAppID: '1:79601577497:ios:5f2bcc6ba8cecddd',
      gcmSenderID: '79601577497',
      apiKey: 'AIzaSyArgmRGfB5kiQT6CunAOmKRVKEsxKmy6YI-G72PVU',
      projectID: 'flutter-firestore',
    ),
  );
  final Firestore firestore = Firestore(app: app);

  CollectionReference get users=> firestore.collection('users');
  await users.where('name', isEqualTo: 'neha').getDocuments();