Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(uploadFile): allow for upload meta to be written to a single firestore doc instead of just collections #665

Open
wildfrontend opened this issue Apr 1, 2019 · 3 comments

Comments

@wildfrontend
Copy link

wildfrontend commented Apr 1, 2019

when i upload file
like

firebase.uploadFiles('images/avatar',files,'images/avatar')

it will produce new uuid and my database are ugly

firebase structure like

images:{
     avatar:{
          GzTbSpMI7fL1m4ae9IFY:{ 
              fullPath:"/doc/image"
              downURL:"https://www.google.com/picture"
          }
     }
}

but i want a single file structure

like

images:{
     avatar:{
              fullPath:"/doc/image"
              downURL:"https://www.google.com/picture"
          }
     }
}

could I ?

@prescottprue
Copy link
Owner

prescottprue commented Apr 1, 2019

You can use uploadFile - uploadFiles assumes you are passing a list of files, which requires pushing to the location provided - otherwise files in the list would run over each other.

The "ugly" you are describing is a unique id created by calling push at that location - this is common when you have a location storing multiple items.

@wildfrontend
Copy link
Author

wildfrontend commented Apr 3, 2019

@prescottprue
i use uploadFile and upload data to firestore but dbpath also create uuid , the function seem create collections when it store image data to firestore

canuploadFile create dbpath to doc not collections?

@jnamkung
Copy link

@Louis-Chen Which version of react-redux-firebase are you using, 2 or 3? Curious because I am having trouble with uploadFiles(storagePath, files, dbPath) using version 3.

@prescottprue prescottprue changed the title Could upload file without default uuid ? feat(uploadFile): allow for upload meta to be written to a single firestore doc instead of just collections Apr 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants