Firebase FieldPath是否在颤振中得到支持?
我在中找不到Firebase FieldPath是否在颤振中得到支持?,firebase,dart,flutter,google-cloud-firestore,Firebase,Dart,Flutter,Google Cloud Firestore,我在中找不到FieldPath,但是,我假设这是一个非常常见的工具,它将是此类插件的首批实现之一 最近添加了,但我在字段路径上找不到任何内容 如果我想在当前的查询中使用documentId,有没有办法实现这一点?我实际上忘记了这一点,但我在某个时候将其添加到了cloud\u firestore 这意味着您可以这样简单地使用它: Firestore.instance.collection('movies').orderBy('rating').orderBy(FieldPath.documentI
FieldPath
,但是,我假设这是一个非常常见的工具,它将是此类插件的首批实现之一
最近添加了,但我在字段路径上找不到任何内容
如果我想在当前的查询中使用documentId
,有没有办法实现这一点?我实际上忘记了这一点,但我在某个时候将其添加到了cloud\u firestore
这意味着您可以这样简单地使用它:
Firestore.instance.collection('movies').orderBy('rating').orderBy(FieldPath.documentId);
过时的
\uuuu name\uuuu
如果要将文档id作为目标,则可以使用
您可以使用“名称”
作为字符串,这相当于字段路径.documentId()
String fieldPathDocumentId='\uuuuuu name\uuuuuuuu';
Firestore.instance.collection('movies').orderBy('rating').orderBy(fieldPathDocumentId);
这对我很有用。(我不确定这是否是您想要的。)
您可以发布一些如何使用它的示例吗?@creativecreatormormaybenot一个人如何使用name作为实例来获取documentId
Firestore.instance.collection('/collection-name')
.where(FieldPath.documentId, isEqualTo: _someID)
.snapshots().listen((snapshots){
/*
*/
});