how to fetch data in firebase by user id [closed]Adding Mobile Number based login mechanism for auth user in firebaseAndroid Firebase realtime database not workingHow to retrieve data and specific user data from the FirebaseFirebase email authentication add username and details to firebase databaseAndroid Firebase .Adding data to specific users Firebase databaseHow to send data from Firebase storage to an email address?Ensuring third party cannot read data in our Firebase Realtime DatabaseIdentify firebase auth and database query timeout in react nativeHow to add child to a List in Firebase Realtime Database with a cloud function?How to stop multiple Firebase events callback on(Value,snapshot)

What happens if you roll doubles 3 times then land on "Go to jail?"

How to be diplomatic in refusing to write code that breaches the privacy of our users

Can the discrete variable be a negative number?

How do I go from 300 unfinished/half written blog posts, to published posts?

How does the UK government determine the size of a mandate?

Purchasing a ticket for someone else in another country?

Customer Requests (Sometimes) Drive Me Bonkers!

Applicability of Single Responsibility Principle

India just shot down a satellite from the ground. At what altitude range is the resulting debris field?

Why are there no referendums in the US?

Is there a korbon needed for conversion?

Do the temporary hit points from the Battlerager barbarian's Reckless Abandon stack if I make multiple attacks on my turn?

What is the opposite of 'gravitas'?

Do sorcerers' Subtle Spells require a skill check to be unseen?

Is there a good way to store credentials outside of a password manager?

Sequence of Tenses: Translating the subjunctive

Implement the Thanos sorting algorithm

Unreliable Magic - Is it worth it?

What does 算不上 mean in 算不上太美好的日子?

How does buying out courses with grant money work?

What is the best translation for "slot" in the context of multiplayer video games?

Failed to fetch jessie backports repository

Escape a backup date in a file name

Would this custom Sorcerer variant that can only learn any verbal-component-only spell be unbalanced?



how to fetch data in firebase by user id [closed]


Adding Mobile Number based login mechanism for auth user in firebaseAndroid Firebase realtime database not workingHow to retrieve data and specific user data from the FirebaseFirebase email authentication add username and details to firebase databaseAndroid Firebase .Adding data to specific users Firebase databaseHow to send data from Firebase storage to an email address?Ensuring third party cannot read data in our Firebase Realtime DatabaseIdentify firebase auth and database query timeout in react nativeHow to add child to a List in Firebase Realtime Database with a cloud function?How to stop multiple Firebase events callback on(Value,snapshot)













-1















I have users inserted into firebase database , every user with his own data (email, name , age ....), I try to get data of a single user - the connected device's user - my function is bringing data but its bringing the entire database , all users , could you please help to solve the issue ,
here is my code :



componentWillMount()
firebase.auth().onAuthStateChanged((user) =>
if (user)
firebase.database().ref('friends')
.on('value', (snapshot) => );

);










share|improve this question









New contributor




hMedia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











closed as unclear what you're asking by Doug Stevenson, André Kool, Andrew, Sinto, AkshayNevrekar Mar 22 at 4:57


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






















    -1















    I have users inserted into firebase database , every user with his own data (email, name , age ....), I try to get data of a single user - the connected device's user - my function is bringing data but its bringing the entire database , all users , could you please help to solve the issue ,
    here is my code :



    componentWillMount()
    firebase.auth().onAuthStateChanged((user) =>
    if (user)
    firebase.database().ref('friends')
    .on('value', (snapshot) => );

    );










    share|improve this question









    New contributor




    hMedia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.











    closed as unclear what you're asking by Doug Stevenson, André Kool, Andrew, Sinto, AkshayNevrekar Mar 22 at 4:57


    Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.




















      -1












      -1








      -1








      I have users inserted into firebase database , every user with his own data (email, name , age ....), I try to get data of a single user - the connected device's user - my function is bringing data but its bringing the entire database , all users , could you please help to solve the issue ,
      here is my code :



      componentWillMount()
      firebase.auth().onAuthStateChanged((user) =>
      if (user)
      firebase.database().ref('friends')
      .on('value', (snapshot) => );

      );










      share|improve this question









      New contributor




      hMedia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have users inserted into firebase database , every user with his own data (email, name , age ....), I try to get data of a single user - the connected device's user - my function is bringing data but its bringing the entire database , all users , could you please help to solve the issue ,
      here is my code :



      componentWillMount()
      firebase.auth().onAuthStateChanged((user) =>
      if (user)
      firebase.database().ref('friends')
      .on('value', (snapshot) => );

      );







      firebase react-native firebase-realtime-database firebase-authentication






      share|improve this question









      New contributor




      hMedia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      hMedia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited Mar 21 at 15:55









      Doug Stevenson

      82.6k1099117




      82.6k1099117






      New contributor




      hMedia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Mar 21 at 15:53









      hMediahMedia

      13




      13




      New contributor




      hMedia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      hMedia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      hMedia is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      closed as unclear what you're asking by Doug Stevenson, André Kool, Andrew, Sinto, AkshayNevrekar Mar 22 at 4:57


      Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









      closed as unclear what you're asking by Doug Stevenson, André Kool, Andrew, Sinto, AkshayNevrekar Mar 22 at 4:57


      Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          If you have not already, you need to split the information regarding each user into subcollections.



          For example: friends > user_1 > email, name, age......



          Then in your Firebase query you need to specify the subcollection. Right now you have it returning every entry under 'friends'. It should look something like this:



          componentWillMount()
          firebase.auth().onAuthStateChanged((user) =>
          if (user)
          firebase.database().ref('friends/' + user.uid) //reference uid of logged in user like so
          .on('value', (snapshot) => );

          );






          share|improve this answer





























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            If you have not already, you need to split the information regarding each user into subcollections.



            For example: friends > user_1 > email, name, age......



            Then in your Firebase query you need to specify the subcollection. Right now you have it returning every entry under 'friends'. It should look something like this:



            componentWillMount()
            firebase.auth().onAuthStateChanged((user) =>
            if (user)
            firebase.database().ref('friends/' + user.uid) //reference uid of logged in user like so
            .on('value', (snapshot) => );

            );






            share|improve this answer



























              0














              If you have not already, you need to split the information regarding each user into subcollections.



              For example: friends > user_1 > email, name, age......



              Then in your Firebase query you need to specify the subcollection. Right now you have it returning every entry under 'friends'. It should look something like this:



              componentWillMount()
              firebase.auth().onAuthStateChanged((user) =>
              if (user)
              firebase.database().ref('friends/' + user.uid) //reference uid of logged in user like so
              .on('value', (snapshot) => );

              );






              share|improve this answer

























                0












                0








                0







                If you have not already, you need to split the information regarding each user into subcollections.



                For example: friends > user_1 > email, name, age......



                Then in your Firebase query you need to specify the subcollection. Right now you have it returning every entry under 'friends'. It should look something like this:



                componentWillMount()
                firebase.auth().onAuthStateChanged((user) =>
                if (user)
                firebase.database().ref('friends/' + user.uid) //reference uid of logged in user like so
                .on('value', (snapshot) => );

                );






                share|improve this answer













                If you have not already, you need to split the information regarding each user into subcollections.



                For example: friends > user_1 > email, name, age......



                Then in your Firebase query you need to specify the subcollection. Right now you have it returning every entry under 'friends'. It should look something like this:



                componentWillMount()
                firebase.auth().onAuthStateChanged((user) =>
                if (user)
                firebase.database().ref('friends/' + user.uid) //reference uid of logged in user like so
                .on('value', (snapshot) => );

                );







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 21 at 17:31









                Troy MyersTroy Myers

                227213




                227213















                    Popular posts from this blog

                    Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                    Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                    Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript