我正在尝试创建一个 firestore 集合。它在回复中给了我以下错误。
"Property images contain an invalid nested entity."
尝试的 JSON 对象如下 -->
{id: '', name: 'service 1', description: 'service 1 desc', status: 'ACTIVE', images: Array(5), …}
内部图像数组,图像对象在下面-->
{fileId: 0, fileName: 'pexels-helena-lopes-697244.jpg', fileType: 'image/jpeg', fileUrl: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD…83creJTiULjHvxWDwOY1BzDLKFS4NspmW7lTMzBg4lT//2Q==', file: File}
最佳答案
Firestore 只能存储其文档 data types 中列出的类型。如果仔细观察,您会发现您的数据包含一个 File
值,该值不在 Firestore 支持的类型列表中。
如果您想将文件内容存储在 Firebase 中,惯用的方法是 upload the file to Cloud Storage然后将其路径(或 download URL )存储在 Firestore 中。
关于javascript - 属性 <Object> 包含无效的嵌套实体。/Firebase,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73182100/