我尝试通过文档的"id“来获取特定文档的信息,以显示该文档的信息。
我在服务中使用的代码是:
class SentenciasFireBase {
//This is a class where I have all the services of firebase
...
obtenerVacaciones(String empleado) async {
//empleado is the document id
return await Firestore.instance.document('Vacaciones/$empleado'
我是Flutter和firestore的初学者。我在firestore中有一个集合,顺序如下: event->'a user specific id'-> post ->'a post id->'post details‘。你可以看到这里的和这里的
当我尝试获取“postdetails”时,我得到的唯一信息是“”DocumentSnapshot“的实例”,请参阅此处的
我尝试过的:
getEvents() async {
setState(() {
_isLoading = true;
});
DocumentSnapshot s
我已经使用了flutter和firebase的电话认证,我完成了登录和插入用户信息,这只是(id,电话,dispalyName)和所有这些信息都存在于认证中,不需要在firestore中创建集合,但现在我在Firestore中创建了一个集合,例如,因此每个用户都应该有许多任务,现在我如何在来自认证的(用户)和来自Firestore的(任务)集合之间建立连接?因为我需要以这种方式添加数据:但是在这里使用集合?可以在不创建用户集合和jsut的情况下使用( user ) from Auth吗?还是不想?非常感谢: onPressed: () {
if(taskTi
我有一个查询、firestore和检索特定用户的函数,但我总是得到相同的错误。
我得到的错误如下:
I/flutter (29600): The following NoSuchMethodError was thrown building SellerInfo(dirty, state:
I/flutter (29600): _SellerInfoState#90e11):
I/flutter (29600): Class 'Future<User>' has no instance getter 'displayName'.
I/flutter
我在Firestore中有这样的数据库结构: ? 这是什么里面的地方 ? 如何在flutter中进行查询以获取Places子集合中的所有数据以及用户集合中的名称,此代码可从每个用户集合中获取所有places子集合数据: Future<List<PlaceModel>> getPlaces() async {
List<PlaceModel> placesList = [];
// get all docs from user collection
var users = await udb.get();
for( var u
对于Firebase实时数据库的安全规则,可以使用以下规则在同一棵树中存在公共数据和私有数据。
但是,在使用Firestore时,它似乎不能使我们这样做,因为我们可以检索的数据只有在集合或文档下。当在同一个文档中定义公共数据和私有数据并获取数据w/ collection/document时,如果我们不是所有者,就会得到私有数据权限不足的错误。
在使用RTDB时,我们可以获得'users/{userId}/publicInfo‘的数据,因为我们对收集/文档一无所知。
有什么方法可以用Firestore来处理RTDB吗?否则,我们应该分开进行公共/私人收藏?
// rule of Fire