Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Property <Object> contains an invalid nested entity. /Firebase

I'm trying to create a firestore collection. It gives me the error below in respose.

"Property images contain an invalid nested entity."

The attempted JSON object is below -->

{id: '', name: 'service 1', description: 'service 1 desc', status: 'ACTIVE', images: Array(5), …}

Inner images array, image object is below-->

{fileId: 0, fileName: 'pexels-helena-lopes-697244.jpg', fileType: 'image/jpeg', fileUrl: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD…83creJTiULjHvxWDwOY1BzDLKFS4NspmW7lTMzBg4lT//2Q==', file: File}
like image 694
kavindu.xo Avatar asked Nov 27 '25 12:11

kavindu.xo


1 Answers

Firestore can only store types that are listed in its documentation on data types. If you look carefully, you can see that your data contains a File value, which is not in the list of types that Firestore supports.

If you want to store the file's contents in Firebase, the idiomatic approach is to upload the file to Cloud Storage and then store its path (or a download URL) in Firestore.

like image 160
Frank van Puffelen Avatar answered Nov 30 '25 02:11

Frank van Puffelen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!