cre*_*not 3 dart firebase flutter google-cloud-firestore
我FieldPath
在cloud_firestore
Flutter 插件中找不到,但是,我认为这是一个非常常见的工具,它将成为此类插件的第一个实现。
FieldValue
最近添加了,但我在 上找不到任何内容FieldPath
。
如果我目前想documentId
在查询中使用,有没有办法实现这一点?
我居然忘了这一点,但我加FieldPath.documentId
为部分拉入请求,以cloud_firestore
在某些时候。
这意味着您可以像这样简单地使用它:
Firestore.instance.collection('movies').orderBy('rating').orderBy(FieldPath.documentId);
Run Code Online (Sandbox Code Playgroud)
__name__
工作,如果你想针对文档ID。
您可以将其'__name__'
用作String
,相当于FieldPath.documentId()
。
String fieldPathDocumentId = '__name__';
Firestore.instance.collection('movies').orderBy('rating').orderBy(fieldPathDocumentId);
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
2016 次 |
最近记录: |