0

I trying retrieve data from firebase.

enter image description here

Rules :

    {
      "rules": {
       "restricted_access": {
            "secret_document" : {
                "message": {
                    ".indexOn": ".value"
            }
          } 
       }
     }
   }

Rest API Call :

https://MyApp.firebaseio.com/restricted_access/secret_document/message.json?orderBy="$value"&equalTo="Course Learning"

but result blank : {} when I call API

enter image description here

when I put "Course Learning" value direct in message then its show result. I need all child level result. message/1/-NCxlHCIYEEewvo2gIKW also have value but its not return in result.

Json structure I can't change and "-NCxlHCIYEEewvo2gIKW" dynamic generated so can't add in rule. how can I get all level child for message?

Sandip Solanki
  • 704
  • 1
  • 8
  • 15

1 Answers1

0

A Firebase Realtime Database query can only have a single unknown key in its path. At a glance it seems that in your data structure both the 1 and the -N... key are unknown. If that is correct, you won't be able to query for notificationType.

Also see: Firebase Query Double Nested

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807