Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何访问firebase中的文档字段?_Firebase_Flutter_Dart_Google Cloud Functions - Fatal编程技术网

如何访问firebase中的文档字段?

如何访问firebase中的文档字段?,firebase,flutter,dart,google-cloud-functions,Firebase,Flutter,Dart,Google Cloud Functions,目前,我正在编写一个云函数,我需要一种方法来获取一些设备的设备id令牌,我已经将其存储在文档集合的字段中 我如何访问它 请帮帮我,我被困在这里了。你可以试试代码: firebaseMessaging.getToken().then((token) { Firestore.instance.collection('collectionName').document(currentUserId).updateData({'pushToken': token});

目前,我正在编写一个云函数,我需要一种方法来获取一些设备的设备id令牌,我已经将其存储在文档集合的字段中

我如何访问它

请帮帮我,我被困在这里了。

你可以试试代码:

firebaseMessaging.getToken().then((token) {
            Firestore.instance.collection('collectionName').document(currentUserId).updateData({'pushToken': token});
        })
请共享您的云功能的完整代码,并指明您要从中获取字段的文档是触发云功能的文档吗?另一个?