Sam
Sam

Reputation: 145

Retrive node data from firebase database

I have linked my app with a firebase database and i am wanting to retrieve the string of one node from it.

The node I am wanting to retrieve is shown below with the name of 'timeStamp'. Is there a way i can retrieve this text and then print it?firebase node

Upvotes: 0

Views: 39

Answers (1)

Jay
Jay

Reputation: 35648

The answer is covered in the Firebase documentation guide

Reading Data

and here's an example:

let ref = FIRDatabase.database().reference()
          .child("Users+infomation/ff..etc/timeStamp")
ref?.observeSingleEvent(of: .value, with: { snapshot in
     let val = snapshot?.value
     print(val!)
})

*this is Swift 3

Upvotes: 2

Related Questions