Last active
May 30, 2018 08:08
-
-
Save PattyAppier/c88df27307d2b9ed70219d6ebb44405c to your computer and use it in GitHub Desktop.
Firebase_DB_codeScript.File_2018-0530
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var var1 = false #Boolean Type | |
fun() { | |
var1 = false | |
Database.database() | |
.reference() | |
.child("Requests Name") | |
.queryOrdered(byChild:"value1 name") | |
.queryEqual(toValue: "alue1 name") | |
.observe(.childAdded, with: { (snapshot) in | |
snapshot.ref.removeValue() | |
Database.database().reference().child("RideRequests").removeAllObservers() | |
}) | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun viewDidLoad() { | |
super.viewDidLoad() | |
Database.database().reference().child("Requests Name").observe(.childAdded, with: { (snapshot) in | |
self.passengersRequests.append(snapshot) | |
self.tableView.reloadData() | |
}) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun(){ | |
Database.database().reference().child("Requests Name") | |
.queryOrdered(byChild: "value1 name") | |
.queryEqual(toValue: get Value for Value1) | |
.observe(.childAdded, with: {(snapshot) in | |
snapshot.ref.updateChildValues(["Value2-1":_, "Value2-2" :_]) | |
Database.database().reference().child("Request Name").removeAllObservers() | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment