0

I want to make a list on the "firebase" project. For example, I need to find out what sort of data I am looking for in the database. I get the data uid: "37dgsj37jdjd8e". I have to get the index where this is. So I have to find out what time it is.

NODE: Result
        Push key -4849dhjfkw8394xh
        name: jhondo to
        timeStamp:"478484939494949"
        mf: "589"
        uid: 74848djtjw38jdjd3

The nodes are formed in this way. OrderByChild ("mf") and uid == searched The query will get this and the resulting index information.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • 1
    It's hard to understand what you're trying to do. Please update your question with the read code you've written, and a snippet of the actual JSON. You can get the latter by clicking the "Export JSON" link in your [Firebase Database console](https://console.firebase.google.com/project/_/database/data). – Frank van Puffelen Jan 07 '18 at 20:41
  • 1
    But if you're trying to order/filter on both child and UID, that won't be possible with your current structure. Firebase Database queries can only order/filter on a single property. In many cases it is possible to combine the values you want to filter on into a single (synthetic) property, e.g. `"uid_mf": "74848djtjw38jdjd3_589"`. For an example of this and other approaches, see my answer here: http://stackoverflow.com/questions/26700924/query-based-on-multiple-where-clauses-in-firebase – Frank van Puffelen Jan 07 '18 at 20:41
  • @FrankvanPuffelen i need filtering orderbychild("mf") and equals(uid) –  Jan 07 '18 at 23:08
  • That is not possible with your current structure, since Firebase can only order/filter on a single property. But if you add a "fake" property `uid_mf` as I commented and describe in my linked answer, you can get that result by `ref.orderByChild("uid_mf").startAt(uid).endAt(uid+"~")`. Give it a try! If you get stuck, post the updated JSON and code and we can have a look at what's going on. – Frank van Puffelen Jan 08 '18 at 15:49

0 Answers0