1

I'm learning about reactJS and for the database I'm using firebase realtime Database.. everything works. but there is one problem..

i have Firebase url like this

https://my-app-name-rtdb.asia-southeast1.firebasedatabase.app/data.json

and the result when get the data

{
  "data" : {
    "-Mc8l24sBroFw8JoA32e" : {
      "data" : {
        "authorized" : {...},
        "authorizedFinance" : {...},
        "authorizedTechnical" : {...},
        "billingAddress" : {...},
        "information" : {...},
        "serviceOrder" : {...},
        "subscriptionFee" : {...},
        "typeofOrder" : {...}
      }
    },
    "-Mc9XCIdCg4FLDzj3Xmg" : {
      "data" : {
        "authorized" : {...},
        "authorizedFinance" : {...},
        "authorizedTechnical" : {...},
        "billingAddress" : {...},
        "information" : {...},
        "serviceOrder" : {...},
        "subscriptionFee" : {...},
        "typeofOrder" : {...}
      }
    }
  }
}

what i want is,just get 1 data by the id -Mc8l24sBroFw8JoA32e.

{
  "data" : {
    "-Mc8l24sBroFw8JoA32e" : {
      "data" : {
        "authorized" : {...},
        "authorizedFinance" : {...},
        "authorizedTechnical" : {...},
        "billingAddress" : {...},
        "information" : {...},
        "serviceOrder" : {...},
        "subscriptionFee" : {...},
        "typeofOrder" : {...}
      }
    }
 }

fireabse

i have tried to pass params in the url like this

https://my-app-name-rtdb.asia-southeast1.firebasedatabase.app/data.json?id=-Mc8l24sBroFw8JoA32e

but is not working. i get the all data..

so, how to do it? is it possible?

2 Answers 2

2

Hi you can navigate through the child nodes in the Realtime Database console by clicking on nodes

It provides a URL for the node you want to access and append .json at last to access it. Make sure your rules and authentication are synced.

So required link would be :

https://my-app-name-rtdb.asia-southeast1.firebaseio.com/data/-Mc8l24sBroFw8JoA32e.json

Ref:

enter image description here

Realtime database - nodes navigation to get link

Hope this helps🤝

Sign up to request clarification or add additional context in comments.

Comments

2

The correct URL to get just that specific key is:

https://my-app-name-rtdb.asia-southeast1.firebasedatabase.app/data/-Mc8l24sBroFw8JoA32e.json

So the .json is last, and before that you have the entire path to the data that you want to retrieve.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.