繁体   English   中英

如何在 Cloud firestore 中动态创建新集合?

[英]How to create new collection in Cloud firestore dynamically?

我需要通过我的 flutter 应用程序使用一些代码在云 Firestore 中的现有集合中创建一个新的子集合。

试试这个

Firestore.instance.collection('oldCollectionName').
document("insideCollectionNameNode").setData({
      'yourKey': "yourValue"
    }).then((result){
      print("result");
    });
  1. “oldCollectionName”是您现有的收藏名称,
  2. “insideCollectionNameNode”是您的新子集合名称,
  3. “yourKey”是子集合数据中的关键数据。
  4. “yourValue”是您在子集合数据中的价值数据。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM