Here is my data structure:
The problem is I don't know how to snap back the Data which is also the Key properly. What I want is only the Key and the value "true" are only markers. And I don't even know what type of data I am currently stored and how to snap the key value back.
What I want this that:
["BAFS", "Econ", "Geog"]
The following is how I write the data:
var subjectvalue: [String] = []
let structure = subjectvalue.reduce(into:[String:String](), { $0[$1] = "true"})
let postRef = Database.database().reference().child("posts").child(id!).child("posts").setValue(structure)
I had been stocked for few days. Anyone have idea to help? Thank you in advance.