Reputation: 322
How to create an Array in Firebase realtime database in iOS using swift
note : I want to be able to append new elements without getting array value first an add element locally then setting it to database .
Upvotes: 0
Views: 889
Reputation: 36
use childByAutoId()
Database.database().reference().child("arrayKey").childByAutoId().setValue("Value") }
Upvotes: 2
Reputation: 1374
This should be achieved easily:
let ref = storageRef.child("your_child")
let array = ["First", "Second", "Third", "Fourth"]
ref.setValue(array)
Upvotes: 1