So my Firebase data structure looks like this:
My question is simple. How do I access the ID's that have been stored via the childByAutoID method i.e. what is the key to their value. The reason I want to do this is because I want to create a variable that will hold the ID, and this only (the value generated by childByAutoId), for example, if you look at My JSON data structure image, KMVrGnR76E6vrj61K21 will be stored in the variable and this alone. My current query looks like this:
databaseRef.child("Jokes").observeSingleEventOfType(.Value, withBlock: { (snapshot) in
let jokeId = snapshot.//something??? not .key as this returns Jokes
})
I understand that the childByAutoId generates a unique identifier, but surely there must be a way to retrieve and store that identifier (this alone, not all of it's children) for obvious reasons...