In Firebase is it possible to see what nodes are being listened too & how do you do it?

Multi tool use
Multi tool use












1















Background



I'm creating an app with firebase, react & node. I would like to lock or warn users if some paths are being listened by multiple connections.



Question



Is it possible to get the number of connections looking at a particular part of the firebase?



Example



If a user is at someDocument/-LS_Ck1XNIyE6fm6QZbM can i see if there's multiple connections at this point?










share|improve this question





























    1















    Background



    I'm creating an app with firebase, react & node. I would like to lock or warn users if some paths are being listened by multiple connections.



    Question



    Is it possible to get the number of connections looking at a particular part of the firebase?



    Example



    If a user is at someDocument/-LS_Ck1XNIyE6fm6QZbM can i see if there's multiple connections at this point?










    share|improve this question



























      1












      1








      1








      Background



      I'm creating an app with firebase, react & node. I would like to lock or warn users if some paths are being listened by multiple connections.



      Question



      Is it possible to get the number of connections looking at a particular part of the firebase?



      Example



      If a user is at someDocument/-LS_Ck1XNIyE6fm6QZbM can i see if there's multiple connections at this point?










      share|improve this question
















      Background



      I'm creating an app with firebase, react & node. I would like to lock or warn users if some paths are being listened by multiple connections.



      Question



      Is it possible to get the number of connections looking at a particular part of the firebase?



      Example



      If a user is at someDocument/-LS_Ck1XNIyE6fm6QZbM can i see if there's multiple connections at this point?







      javascript firebase sockets firebase-realtime-database






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 2 at 16:19









      Frank van Puffelen

      241k29385413




      241k29385413










      asked Jan 2 at 15:54









      Joe LloydJoe Lloyd

      4,08642948




      4,08642948
























          2 Answers
          2






          active

          oldest

          votes


















          2














          Yup. The Firebase Realtime Database can be used to build such a presence system. I recommend checking out the sample presence system in the documentation, as well as the documentation on the same page on detecting connection state and how onDisconnect works.






          share|improve this answer
























          • Thanks Frank. I was looking in the wrong part of the docs. This looks good.

            – Joe Lloyd
            Jan 2 at 16:09











          • Maybe I understood the question wrong, but it seems to me that this solution will not provide the granularity implied in the original post.

            – Sami Hult
            Jan 2 at 16:11











          • Ah... I went of the title, which I now updated to reflect the actual question better. There is no way to track the current listeners. The closest I can think of is using the database profiler: firebase.google.com/docs/database/usage/profile

            – Frank van Puffelen
            Jan 2 at 16:20













          • I quickly checked and the database profiler shows the data for all users connected to your database. It only shows it in aggregate, but you'd at least be able to get an idea of where most activity is.

            – Frank van Puffelen
            Jan 5 at 15:54



















          1














          I understood the question so that you want to limit reading data from some path to only limited number of users/connections.



          There is no documented way of achieving this directly.



          What I would suggest is to write restrictive database rules to prohibit direct access to this data. Then you could write a cloud function to implement this logic - administrative interface will circumvent the database rules.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54009317%2fin-firebase-is-it-possible-to-see-what-nodes-are-being-listened-too-how-do-you%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            Yup. The Firebase Realtime Database can be used to build such a presence system. I recommend checking out the sample presence system in the documentation, as well as the documentation on the same page on detecting connection state and how onDisconnect works.






            share|improve this answer
























            • Thanks Frank. I was looking in the wrong part of the docs. This looks good.

              – Joe Lloyd
              Jan 2 at 16:09











            • Maybe I understood the question wrong, but it seems to me that this solution will not provide the granularity implied in the original post.

              – Sami Hult
              Jan 2 at 16:11











            • Ah... I went of the title, which I now updated to reflect the actual question better. There is no way to track the current listeners. The closest I can think of is using the database profiler: firebase.google.com/docs/database/usage/profile

              – Frank van Puffelen
              Jan 2 at 16:20













            • I quickly checked and the database profiler shows the data for all users connected to your database. It only shows it in aggregate, but you'd at least be able to get an idea of where most activity is.

              – Frank van Puffelen
              Jan 5 at 15:54
















            2














            Yup. The Firebase Realtime Database can be used to build such a presence system. I recommend checking out the sample presence system in the documentation, as well as the documentation on the same page on detecting connection state and how onDisconnect works.






            share|improve this answer
























            • Thanks Frank. I was looking in the wrong part of the docs. This looks good.

              – Joe Lloyd
              Jan 2 at 16:09











            • Maybe I understood the question wrong, but it seems to me that this solution will not provide the granularity implied in the original post.

              – Sami Hult
              Jan 2 at 16:11











            • Ah... I went of the title, which I now updated to reflect the actual question better. There is no way to track the current listeners. The closest I can think of is using the database profiler: firebase.google.com/docs/database/usage/profile

              – Frank van Puffelen
              Jan 2 at 16:20













            • I quickly checked and the database profiler shows the data for all users connected to your database. It only shows it in aggregate, but you'd at least be able to get an idea of where most activity is.

              – Frank van Puffelen
              Jan 5 at 15:54














            2












            2








            2







            Yup. The Firebase Realtime Database can be used to build such a presence system. I recommend checking out the sample presence system in the documentation, as well as the documentation on the same page on detecting connection state and how onDisconnect works.






            share|improve this answer













            Yup. The Firebase Realtime Database can be used to build such a presence system. I recommend checking out the sample presence system in the documentation, as well as the documentation on the same page on detecting connection state and how onDisconnect works.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 2 at 16:04









            Frank van PuffelenFrank van Puffelen

            241k29385413




            241k29385413













            • Thanks Frank. I was looking in the wrong part of the docs. This looks good.

              – Joe Lloyd
              Jan 2 at 16:09











            • Maybe I understood the question wrong, but it seems to me that this solution will not provide the granularity implied in the original post.

              – Sami Hult
              Jan 2 at 16:11











            • Ah... I went of the title, which I now updated to reflect the actual question better. There is no way to track the current listeners. The closest I can think of is using the database profiler: firebase.google.com/docs/database/usage/profile

              – Frank van Puffelen
              Jan 2 at 16:20













            • I quickly checked and the database profiler shows the data for all users connected to your database. It only shows it in aggregate, but you'd at least be able to get an idea of where most activity is.

              – Frank van Puffelen
              Jan 5 at 15:54



















            • Thanks Frank. I was looking in the wrong part of the docs. This looks good.

              – Joe Lloyd
              Jan 2 at 16:09











            • Maybe I understood the question wrong, but it seems to me that this solution will not provide the granularity implied in the original post.

              – Sami Hult
              Jan 2 at 16:11











            • Ah... I went of the title, which I now updated to reflect the actual question better. There is no way to track the current listeners. The closest I can think of is using the database profiler: firebase.google.com/docs/database/usage/profile

              – Frank van Puffelen
              Jan 2 at 16:20













            • I quickly checked and the database profiler shows the data for all users connected to your database. It only shows it in aggregate, but you'd at least be able to get an idea of where most activity is.

              – Frank van Puffelen
              Jan 5 at 15:54

















            Thanks Frank. I was looking in the wrong part of the docs. This looks good.

            – Joe Lloyd
            Jan 2 at 16:09





            Thanks Frank. I was looking in the wrong part of the docs. This looks good.

            – Joe Lloyd
            Jan 2 at 16:09













            Maybe I understood the question wrong, but it seems to me that this solution will not provide the granularity implied in the original post.

            – Sami Hult
            Jan 2 at 16:11





            Maybe I understood the question wrong, but it seems to me that this solution will not provide the granularity implied in the original post.

            – Sami Hult
            Jan 2 at 16:11













            Ah... I went of the title, which I now updated to reflect the actual question better. There is no way to track the current listeners. The closest I can think of is using the database profiler: firebase.google.com/docs/database/usage/profile

            – Frank van Puffelen
            Jan 2 at 16:20







            Ah... I went of the title, which I now updated to reflect the actual question better. There is no way to track the current listeners. The closest I can think of is using the database profiler: firebase.google.com/docs/database/usage/profile

            – Frank van Puffelen
            Jan 2 at 16:20















            I quickly checked and the database profiler shows the data for all users connected to your database. It only shows it in aggregate, but you'd at least be able to get an idea of where most activity is.

            – Frank van Puffelen
            Jan 5 at 15:54





            I quickly checked and the database profiler shows the data for all users connected to your database. It only shows it in aggregate, but you'd at least be able to get an idea of where most activity is.

            – Frank van Puffelen
            Jan 5 at 15:54













            1














            I understood the question so that you want to limit reading data from some path to only limited number of users/connections.



            There is no documented way of achieving this directly.



            What I would suggest is to write restrictive database rules to prohibit direct access to this data. Then you could write a cloud function to implement this logic - administrative interface will circumvent the database rules.






            share|improve this answer




























              1














              I understood the question so that you want to limit reading data from some path to only limited number of users/connections.



              There is no documented way of achieving this directly.



              What I would suggest is to write restrictive database rules to prohibit direct access to this data. Then you could write a cloud function to implement this logic - administrative interface will circumvent the database rules.






              share|improve this answer


























                1












                1








                1







                I understood the question so that you want to limit reading data from some path to only limited number of users/connections.



                There is no documented way of achieving this directly.



                What I would suggest is to write restrictive database rules to prohibit direct access to this data. Then you could write a cloud function to implement this logic - administrative interface will circumvent the database rules.






                share|improve this answer













                I understood the question so that you want to limit reading data from some path to only limited number of users/connections.



                There is no documented way of achieving this directly.



                What I would suggest is to write restrictive database rules to prohibit direct access to this data. Then you could write a cloud function to implement this logic - administrative interface will circumvent the database rules.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 2 at 16:09









                Sami HultSami Hult

                2,3871613




                2,3871613






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54009317%2fin-firebase-is-it-possible-to-see-what-nodes-are-being-listened-too-how-do-you%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    8C3c5mI xt,aqsHEMqKOt1lmeUiRZXXDg x 288t2sYGuiP,OedP9Dn2x2UrWMq9Pc
                    heRKUU3yE fA93 skkoxVyqu ypXc9xJrcaU6 Q,6vXQ0mA5G6m4tPhyq U83Ll4mG1Ki,LI9,eM,ez8B

                    Popular posts from this blog

                    Monofisismo

                    Angular Downloading a file using contenturl with Basic Authentication

                    Olmecas