Hello,

I have an issue with the val() function.
I am searching a *pseudo *in the *users* and when I retrieve the value, I
got this: Object { facebook:10205190339736136={...}}

The variable "pseudo" is not directly reachable... (see code below).
How can I access this variable without knowing the object ID ?



var refPseudo = new Firebase("https://xxxx.firebaseio.com/users/").
orderByChild('pseudo').equalTo($scope.formParams.pseudo);
         refPseudo.once('value', function(snap) {
         console.log('Pseudo used by:', snap.val());
         console.log('Pseudo is:', snap.val().pseudo); // Pseudo object does
not exist !!!
});


--
You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
To post to this group, send email to firebase-angular@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/2c840322-caea-4e3e-96ad-b25802090323%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Jacob Wenger at Jan 11, 2015 at 5:28 pm
    Hey Adrien,

    Since you did a once("value") listener, you will get a snapshot containing
    all matching children, keyed by their push ID. Since this is not what you
    want in this case, try doing a once("child_added") to just get the first
    matched child. Then, your other existing code should work.

    Jacob
    On Sun, Jan 11, 2015 at 6:52 AM, Adrien Grand wrote:

    Hello,

    I have an issue with the val() function.
    I am searching a *pseudo *in the *users* and when I retrieve the value, I
    got this: Object { facebook:10205190339736136={...}}

    The variable "pseudo" is not directly reachable... (see code below).
    How can I access this variable without knowing the object ID ?



    var refPseudo = new Firebase("https://xxxx.firebaseio.com/users/").
    orderByChild('pseudo').equalTo($scope.formParams.pseudo);
    refPseudo.once('value', function(snap) {
    console.log('Pseudo used by:', snap.val());
    console.log('Pseudo is:', snap.val().pseudo); // Pseudo object
    does not exist !!!
    });


    --
    You received this message because you are subscribed to the Google Groups
    "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/firebase-angular/2c840322-caea-4e3e-96ad-b25802090323%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/2c840322-caea-4e3e-96ad-b25802090323%40googlegroups.com?utm_medium=email&utm_source=footer>
    .
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/CAGcMwsA%2BfPkkEQLhtHps1p45t4EWYS2wbMyt3Rnd-bgPk3wx-g%40mail.gmail.com.
    For more options, visit https://groups.google.com/d/optout.
  • Adrien Grand at Jan 11, 2015 at 8:24 pm
    Thanks a lot Jacob !!!
    It works great this way.

    Le dimanche 11 janvier 2015 18:28:36 UTC+1, Jacob Wenger a écrit :
    Hey Adrien,

    Since you did a once("value") listener, you will get a snapshot
    containing all matching children, keyed by their push ID. Since this is not
    what you want in this case, try doing a once("child_added") to just get
    the first matched child. Then, your other existing code should work.

    Jacob

    On Sun, Jan 11, 2015 at 6:52 AM, Adrien Grand <didi...@gmail.com
    <javascript:>> wrote:
    Hello,

    I have an issue with the val() function.
    I am searching a *pseudo *in the *users* and when I retrieve the value,
    I got this: Object { facebook:10205190339736136={...}}

    The variable "pseudo" is not directly reachable... (see code below).
    How can I access this variable without knowing the object ID ?



    var refPseudo = new Firebase("https://xxxx.firebaseio.com/users/").
    orderByChild('pseudo').equalTo($scope.formParams.pseudo);
    refPseudo.once('value', function(snap) {
    console.log('Pseudo used by:', snap.val());
    console.log('Pseudo is:', snap.val().pseudo); // Pseudo object
    does not exist !!!
    });


    --
    You received this message because you are subscribed to the Google Groups
    "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to firebase-angul...@googlegroups.com <javascript:>.
    To post to this group, send email to firebase...@googlegroups.com
    <javascript:>.
    To view this discussion on the web visit
    https://groups.google.com/d/msgid/firebase-angular/2c840322-caea-4e3e-96ad-b25802090323%40googlegroups.com
    <https://groups.google.com/d/msgid/firebase-angular/2c840322-caea-4e3e-96ad-b25802090323%40googlegroups.com?utm_medium=email&utm_source=footer>
    .
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
    To post to this group, send email to firebase-angular@googlegroups.com.
    To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/2720901e-0002-4daa-9e4f-9335f2ba4140%40googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupfirebase-angular @
postedJan 11, '15 at 5:25p
activeJan 11, '15 at 8:24p
posts3
users2

2 users in discussion

Adrien Grand: 2 posts Jacob Wenger: 1 post

People

Translate

site design / logo © 2021 Grokbase