0

I'm having a problem trying to search images in my storage instance because I have the following structure:

/cityx/cars/{userId}/{numberPlate}/image_1
/cityx/cars/{userId}/{numberPlate}/image_2
/cityx/cars/{userId}/{numberPlate}/image_3

Each user have it's own folder {userId} and within that folder, has registered many cars indexed by the {numberPlate} and finally inside that {numberPlate} folder exists pictures related to the user so I'm performing a search by the numberPlate but the issue I have is related to.. how to search it having the parent folder with a dynamically name (the userId).

Do you know how to perform a search like that?

Kind regards!

SoldierCorp
  • 7,610
  • 16
  • 60
  • 100

1 Answers1

0

The Firebase Storage API doesn't have the ability to search for images. You must know the full path already to find/load an image.

So if you want to be able to search for specific images, you should store the metadata about the images elsewhere. One common place for structured metadata would be the Firebase Database, such as covered here: How to get an array with all pictures?

If you want more wildcard-like search, you'll want to look into integrating an external search engine, such as Elastic Search.

Community
  • 1
  • 1
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • Actually I don't want to get the list of files within a folder just the reference of the parent of those images which is {numberPlate} folder so with that I can easily get the pictures of that folder. – SoldierCorp Nov 21 '16 at 19:49