Hi I have been struggling with data structure in my app. I was initially trying to structure it as: parent: node: data node: data:
But I was unable to build this for some reason. So I extended to 2 databases, 1 for user data, and 1 for storing other data about the user.
Problem is I can't seem to get Swift to recognise the 2nd DB and write data to it. Here is my code, id appreciate any input as to what Im doing wrong.
func sendUID() {
let uid = Auth.auth().currentUser?.uid
// Get a secondary database instance by URL
var db2: DatabaseReference!
db2 = Database.database(url: "https://flight-userid.firebaseio.com/").reference()
db2.child("users").child(uid!)
}