【发布时间】:2019-12-29 04:23:16
【问题描述】:
你好,如何在 react native 中将一组图像 url 上传到 firestore 我试过这个
state = { photos: [] };
buttonPress() {
const { photos } = this.state;
firebase.firestore().collection('users').doc('images')
.add({ photos });
}
但图像会在 firestore 数据库中显示为这样
{
"book": "Robin hood",
"photos": "https://picsum.photos/id/1001/5616/3744",
}
我希望它改为显示在 firestore 数据库中这样的数组中
{
"book": "Robin hood",
"photos": [ "https://picsum.photos/id/1001/5616/3744"],
}
【问题讨论】:
标签: reactjs firebase react-native google-cloud-firestore