如何获取“内容”为“test2”的文档 ID?在这里输入图像描述我尝试这样..但条件不起作用。
ref.where(ref.doc('content') == 'test2').get().then((QuerySnapshot snapshot){
snapshot.docs.forEach((document){
print(document.id);
});
});
如何获取特定文档的文档 ID?(我使用flutter和cloud firestore)
假设ref
是您的收藏参考,请使用:
await ref.where('contents', isEqualTo: 'test2').get().then((QuerySnapshot snapshot){
snapshot.docs.forEach((document){
print(document.id);
});
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句