FabricioG
FabricioG

Reputation: 3310

Firebase getValue() not functioning as expected

Error getValue() is not a function. According to the documentation I've read snapshot.getValue() should return the value with out the key.

I do the following:

firebase.attendanceNotes(props.orgId, props.data.uid)
    .limitToLast(1)
    .once('value')
    .then(returnedNotes => {
      console.log(returnedNotes.getValue());
    })

This kicks out the error I mentioned above. What am I doing wrong?

Upvotes: 0

Views: 124

Answers (1)

Stratubas
Stratubas

Reputation: 3067

Your code looks like it's JavaScript.

getValue() is for Java. In JavaScript it's val().

Upvotes: 2

Related Questions