简体   繁体   中英

How do I do a content search in Firebase?

I have about 300 records stored in FireBase .

The structure of each record looks something like:

unique ID/key (e.g. -K1vsg7F4V_5usvPejZV)
 - city
 - firstName
 - lastName
 - image (encoded as base64)

With the images especially, a current export is 15Mb .

So everytime I want to do search for, say a first name, I need to download 15Mb and then do a search on that data in the browser. It's incredibly bandwidth heavy and slow to use this way.

I've been reading up online that content searches is coming? But I don't see it yet?

Thoughts? Or have I missed something obvious?

Why download data and do another search? Just query for the firstName you are interested in.

ref.orderByChild("firstName").equalTo("Kato")

Another super simple option is to store your images in another node using the same key.

images
  unique ID/key
      image:
  unique ID/key
      image:

Then you only load in the image you need when it's needed and won't affect your other data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM