Swift Firebase match UID keys with a array of UID strings The 2019 Stack Overflow Developer Survey Results Are InSwift for loop: for index, element in array?Swift Beta performance: sorting arraysSplit a String into an array in Swift?Swift Firebase - Array of items based on UIDFirebase iOS: createUserWithEmail isn't generating userId (uid)Firebase Swift .exist() not workingSwift Firebase access data inside child snapshot (by childAdded)Find Firebase Child from Array Values - xcode 8 / swift 3retrieve current user data from the firebaseHow can I save the amount of steps taken in a day to the firebase database?
Can an undergraduate be advised by a professor who is very far away?
Did Scotland spend $250,000 for the slogan "Welcome to Scotland"?
How do you keep chess fun when your opponent constantly beats you?
The difference between dialogue marks
If my opponent casts Ultimate Price on my Phantasmal Bear, can I save it by casting Snap or Curfew?
Button changing its text & action. Good or terrible?
Variable with quotation marks "$()"
Output the Arecibo Message
The phrase "to the numbers born"?
Is there a way to generate a uniformly distributed point on a sphere from a fixed amount of random real numbers?
What to do when moving next to a bird sanctuary with a loosely-domesticated cat?
How to notate time signature switching consistently every measure
Why doesn't shell automatically fix "useless use of cat"?
How much of the clove should I use when using big garlic heads?
How to support a colleague who finds meetings extremely tiring?
What is preventing me from simply constructing a hash that's lower than the current target?
ELI5: Why they say that Israel would have been the fourth country to land a spacecraft on the Moon and why they call it low cost?
Correct punctuation for showing a character's confusion
What is this sharp, curved notch on my knife for?
Dropping list elements from nested list after evaluation
Are there any other methods to apply to solving simultaneous equations?
Short story: child made less intelligent and less attractive
How to quickly solve partial fractions equation?
If climate change impact can be observed in nature, has that had any effect on rural, i.e. farming community, perception of the scientific consensus?
Swift Firebase match UID keys with a array of UID strings
The 2019 Stack Overflow Developer Survey Results Are InSwift for loop: for index, element in array?Swift Beta performance: sorting arraysSplit a String into an array in Swift?Swift Firebase - Array of items based on UIDFirebase iOS: createUserWithEmail isn't generating userId (uid)Firebase Swift .exist() not workingSwift Firebase access data inside child snapshot (by childAdded)Find Firebase Child from Array Values - xcode 8 / swift 3retrieve current user data from the firebaseHow can I save the amount of steps taken in a day to the firebase database?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am trying to figure out how I can match the Strings which are Firebase UID's in my "data" array with the keys that I am extracting from the firebase call. I need to match the Strings in the "data" array with "key" and then I will be able to manipulate the data how I want.
var data = [String]()
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
guard let allUsers = snapshot.children.allObjects as? [DataSnapshot] else return
print(allUsers)
print("Printing all users right here")
for user in allUsers
let key = user.key
print(key)
print("Printing the keys right here come and check this out in the print")
)
My try, answer not in this code
Database.database().reference().child("Businesses").observeSingleEvent(of: .value, with: snapshot in
self.businessUID = snapshot.value as? NSDictionary
if let dict = snapshot.value as? NSDictionary
for item in dict
let json = JSON(item.value)
let businessUid = json["uid"].stringValue
for uid in self.data
if uid == businessUid
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
guard let allUsers = snapshot.children.allObjects as? [DataSnapshot] else return
print(allUsers)
print("Printing all users right here")
for user in allUsers
let key = user.key
print(key)
print("Printing the keys right here come and check this out in the print")
if key == uid
print(key)
print("printing the matching keys here")
)
print(uid)
print("Printing the uids here")
Database.database().reference().child("Businesses").child(self.businessessuids).observe(.value, with: snapshot in
print(snapshot)
print(self.businessessuids)
)
)
UPDATE: Found matching values but cannot save
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
if snapshot.exists()
for snapChild in snapshot.children
if let user: Dictionary? = (snapChild as! DataSnapshot).value as? [String : AnyObject]
let businessUID = user!["uid"] as! String
for uid in self.data
if uid == businessUID
let key = uid.jsonKey
print(key)
//print(uid)
print("checking uid's")
//let name = user.childSnapshot(forPath: "name").value as! String
let Ref = Database.database().reference().child("testing")
let saveUID = Ref.child(key).child("their_name")
)
ios swift firebase firebase-realtime-database
|
show 4 more comments
I am trying to figure out how I can match the Strings which are Firebase UID's in my "data" array with the keys that I am extracting from the firebase call. I need to match the Strings in the "data" array with "key" and then I will be able to manipulate the data how I want.
var data = [String]()
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
guard let allUsers = snapshot.children.allObjects as? [DataSnapshot] else return
print(allUsers)
print("Printing all users right here")
for user in allUsers
let key = user.key
print(key)
print("Printing the keys right here come and check this out in the print")
)
My try, answer not in this code
Database.database().reference().child("Businesses").observeSingleEvent(of: .value, with: snapshot in
self.businessUID = snapshot.value as? NSDictionary
if let dict = snapshot.value as? NSDictionary
for item in dict
let json = JSON(item.value)
let businessUid = json["uid"].stringValue
for uid in self.data
if uid == businessUid
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
guard let allUsers = snapshot.children.allObjects as? [DataSnapshot] else return
print(allUsers)
print("Printing all users right here")
for user in allUsers
let key = user.key
print(key)
print("Printing the keys right here come and check this out in the print")
if key == uid
print(key)
print("printing the matching keys here")
)
print(uid)
print("Printing the uids here")
Database.database().reference().child("Businesses").child(self.businessessuids).observe(.value, with: snapshot in
print(snapshot)
print(self.businessessuids)
)
)
UPDATE: Found matching values but cannot save
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
if snapshot.exists()
for snapChild in snapshot.children
if let user: Dictionary? = (snapChild as! DataSnapshot).value as? [String : AnyObject]
let businessUID = user!["uid"] as! String
for uid in self.data
if uid == businessUID
let key = uid.jsonKey
print(key)
//print(uid)
print("checking uid's")
//let name = user.childSnapshot(forPath: "name").value as! String
let Ref = Database.database().reference().child("testing")
let saveUID = Ref.child(key).child("their_name")
)
ios swift firebase firebase-realtime-database
Can you attach your Firebase table ofallUsers
?
– Amir Khan
Mar 22 at 5:08
What is it that you want to see? All you would see if the parent "Businesses" then the UIDs then the data that uid's hold
– Lukas Bimba
Mar 22 at 5:11
Yes whatallUsers
contains ? more precisely, the structure ofallUsers
.
– Amir Khan
Mar 22 at 5:12
Just added it. Thats just a sample because it keeps going for a while lol
– Lukas Bimba
Mar 22 at 5:18
Got that. Thanks. Let me dig into this.
– Amir Khan
Mar 22 at 5:31
|
show 4 more comments
I am trying to figure out how I can match the Strings which are Firebase UID's in my "data" array with the keys that I am extracting from the firebase call. I need to match the Strings in the "data" array with "key" and then I will be able to manipulate the data how I want.
var data = [String]()
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
guard let allUsers = snapshot.children.allObjects as? [DataSnapshot] else return
print(allUsers)
print("Printing all users right here")
for user in allUsers
let key = user.key
print(key)
print("Printing the keys right here come and check this out in the print")
)
My try, answer not in this code
Database.database().reference().child("Businesses").observeSingleEvent(of: .value, with: snapshot in
self.businessUID = snapshot.value as? NSDictionary
if let dict = snapshot.value as? NSDictionary
for item in dict
let json = JSON(item.value)
let businessUid = json["uid"].stringValue
for uid in self.data
if uid == businessUid
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
guard let allUsers = snapshot.children.allObjects as? [DataSnapshot] else return
print(allUsers)
print("Printing all users right here")
for user in allUsers
let key = user.key
print(key)
print("Printing the keys right here come and check this out in the print")
if key == uid
print(key)
print("printing the matching keys here")
)
print(uid)
print("Printing the uids here")
Database.database().reference().child("Businesses").child(self.businessessuids).observe(.value, with: snapshot in
print(snapshot)
print(self.businessessuids)
)
)
UPDATE: Found matching values but cannot save
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
if snapshot.exists()
for snapChild in snapshot.children
if let user: Dictionary? = (snapChild as! DataSnapshot).value as? [String : AnyObject]
let businessUID = user!["uid"] as! String
for uid in self.data
if uid == businessUID
let key = uid.jsonKey
print(key)
//print(uid)
print("checking uid's")
//let name = user.childSnapshot(forPath: "name").value as! String
let Ref = Database.database().reference().child("testing")
let saveUID = Ref.child(key).child("their_name")
)
ios swift firebase firebase-realtime-database
I am trying to figure out how I can match the Strings which are Firebase UID's in my "data" array with the keys that I am extracting from the firebase call. I need to match the Strings in the "data" array with "key" and then I will be able to manipulate the data how I want.
var data = [String]()
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
guard let allUsers = snapshot.children.allObjects as? [DataSnapshot] else return
print(allUsers)
print("Printing all users right here")
for user in allUsers
let key = user.key
print(key)
print("Printing the keys right here come and check this out in the print")
)
My try, answer not in this code
Database.database().reference().child("Businesses").observeSingleEvent(of: .value, with: snapshot in
self.businessUID = snapshot.value as? NSDictionary
if let dict = snapshot.value as? NSDictionary
for item in dict
let json = JSON(item.value)
let businessUid = json["uid"].stringValue
for uid in self.data
if uid == businessUid
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
guard let allUsers = snapshot.children.allObjects as? [DataSnapshot] else return
print(allUsers)
print("Printing all users right here")
for user in allUsers
let key = user.key
print(key)
print("Printing the keys right here come and check this out in the print")
if key == uid
print(key)
print("printing the matching keys here")
)
print(uid)
print("Printing the uids here")
Database.database().reference().child("Businesses").child(self.businessessuids).observe(.value, with: snapshot in
print(snapshot)
print(self.businessessuids)
)
)
UPDATE: Found matching values but cannot save
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
if snapshot.exists()
for snapChild in snapshot.children
if let user: Dictionary? = (snapChild as! DataSnapshot).value as? [String : AnyObject]
let businessUID = user!["uid"] as! String
for uid in self.data
if uid == businessUID
let key = uid.jsonKey
print(key)
//print(uid)
print("checking uid's")
//let name = user.childSnapshot(forPath: "name").value as! String
let Ref = Database.database().reference().child("testing")
let saveUID = Ref.child(key).child("their_name")
)
ios swift firebase firebase-realtime-database
ios swift firebase firebase-realtime-database
edited Mar 23 at 4:43
Lukas Bimba
asked Mar 22 at 5:01
Lukas BimbaLukas Bimba
221118
221118
Can you attach your Firebase table ofallUsers
?
– Amir Khan
Mar 22 at 5:08
What is it that you want to see? All you would see if the parent "Businesses" then the UIDs then the data that uid's hold
– Lukas Bimba
Mar 22 at 5:11
Yes whatallUsers
contains ? more precisely, the structure ofallUsers
.
– Amir Khan
Mar 22 at 5:12
Just added it. Thats just a sample because it keeps going for a while lol
– Lukas Bimba
Mar 22 at 5:18
Got that. Thanks. Let me dig into this.
– Amir Khan
Mar 22 at 5:31
|
show 4 more comments
Can you attach your Firebase table ofallUsers
?
– Amir Khan
Mar 22 at 5:08
What is it that you want to see? All you would see if the parent "Businesses" then the UIDs then the data that uid's hold
– Lukas Bimba
Mar 22 at 5:11
Yes whatallUsers
contains ? more precisely, the structure ofallUsers
.
– Amir Khan
Mar 22 at 5:12
Just added it. Thats just a sample because it keeps going for a while lol
– Lukas Bimba
Mar 22 at 5:18
Got that. Thanks. Let me dig into this.
– Amir Khan
Mar 22 at 5:31
Can you attach your Firebase table of
allUsers
?– Amir Khan
Mar 22 at 5:08
Can you attach your Firebase table of
allUsers
?– Amir Khan
Mar 22 at 5:08
What is it that you want to see? All you would see if the parent "Businesses" then the UIDs then the data that uid's hold
– Lukas Bimba
Mar 22 at 5:11
What is it that you want to see? All you would see if the parent "Businesses" then the UIDs then the data that uid's hold
– Lukas Bimba
Mar 22 at 5:11
Yes what
allUsers
contains ? more precisely, the structure of allUsers
.– Amir Khan
Mar 22 at 5:12
Yes what
allUsers
contains ? more precisely, the structure of allUsers
.– Amir Khan
Mar 22 at 5:12
Just added it. Thats just a sample because it keeps going for a while lol
– Lukas Bimba
Mar 22 at 5:18
Just added it. Thats just a sample because it keeps going for a while lol
– Lukas Bimba
Mar 22 at 5:18
Got that. Thanks. Let me dig into this.
– Amir Khan
Mar 22 at 5:31
Got that. Thanks. Let me dig into this.
– Amir Khan
Mar 22 at 5:31
|
show 4 more comments
2 Answers
2
active
oldest
votes
I've done some changes in snapshot. Though I haven't verify as I don't have any Firebase database setup at my end as yours.
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
if snapshot.exists()
for snapChild in snapshot.children
if let user: Dictionary? = (snapChild as! DataSnapshot).value as? [String : AnyObject]
debugPrint("User uid: ", user!["uid"] as! String)
)
Replace your call with above code snippet and let me know if you are still having any issue.
Note: You can also improvisation you all user structure into model for better use.
Hey, just seeing this. I am going to check it out and let you know.
– Lukas Bimba
Mar 22 at 18:55
I understand why you said that "var data = [String]()" is empty, yet it isn't. Imagine it has 2 uid strings within it and whats needed is a compare to "user" for matching UID's. Im posting code I was trying before. This code I am posted is not with your answer just my attempts.
– Lukas Bimba
Mar 23 at 1:31
With my added code, you'll see I compare the JSON string UID by doing "for uid in self.data"
– Lukas Bimba
Mar 23 at 1:35
Hey can you check out my update on your code? I matched the values but cannot save because "uid.jsonKey" is not a proper String.
– Lukas Bimba
Mar 23 at 4:44
I am currently trying some other methods of attack
– Lukas Bimba
Mar 23 at 4:46
add a comment |
This works. Great Success!
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
if snapshot.exists()
for snapChild in snapshot.children
if let user: Dictionary? = (snapChild as! DataSnapshot).value as? [String : AnyObject]
let businessUID = user!["uid"] as! String
for uid in self.data
if uid == businessUID
let key = uid.description
print(key)
print("checking uid's")
let Ref = Database.database().reference().child("testing")
let saveUID = Ref.child(key).child("tested")
saveUID.setValue("String")
)
That's awesome!
– Amir Khan
Mar 23 at 5:03
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55293180%2fswift-firebase-match-uid-keys-with-a-array-of-uid-strings%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I've done some changes in snapshot. Though I haven't verify as I don't have any Firebase database setup at my end as yours.
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
if snapshot.exists()
for snapChild in snapshot.children
if let user: Dictionary? = (snapChild as! DataSnapshot).value as? [String : AnyObject]
debugPrint("User uid: ", user!["uid"] as! String)
)
Replace your call with above code snippet and let me know if you are still having any issue.
Note: You can also improvisation you all user structure into model for better use.
Hey, just seeing this. I am going to check it out and let you know.
– Lukas Bimba
Mar 22 at 18:55
I understand why you said that "var data = [String]()" is empty, yet it isn't. Imagine it has 2 uid strings within it and whats needed is a compare to "user" for matching UID's. Im posting code I was trying before. This code I am posted is not with your answer just my attempts.
– Lukas Bimba
Mar 23 at 1:31
With my added code, you'll see I compare the JSON string UID by doing "for uid in self.data"
– Lukas Bimba
Mar 23 at 1:35
Hey can you check out my update on your code? I matched the values but cannot save because "uid.jsonKey" is not a proper String.
– Lukas Bimba
Mar 23 at 4:44
I am currently trying some other methods of attack
– Lukas Bimba
Mar 23 at 4:46
add a comment |
I've done some changes in snapshot. Though I haven't verify as I don't have any Firebase database setup at my end as yours.
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
if snapshot.exists()
for snapChild in snapshot.children
if let user: Dictionary? = (snapChild as! DataSnapshot).value as? [String : AnyObject]
debugPrint("User uid: ", user!["uid"] as! String)
)
Replace your call with above code snippet and let me know if you are still having any issue.
Note: You can also improvisation you all user structure into model for better use.
Hey, just seeing this. I am going to check it out and let you know.
– Lukas Bimba
Mar 22 at 18:55
I understand why you said that "var data = [String]()" is empty, yet it isn't. Imagine it has 2 uid strings within it and whats needed is a compare to "user" for matching UID's. Im posting code I was trying before. This code I am posted is not with your answer just my attempts.
– Lukas Bimba
Mar 23 at 1:31
With my added code, you'll see I compare the JSON string UID by doing "for uid in self.data"
– Lukas Bimba
Mar 23 at 1:35
Hey can you check out my update on your code? I matched the values but cannot save because "uid.jsonKey" is not a proper String.
– Lukas Bimba
Mar 23 at 4:44
I am currently trying some other methods of attack
– Lukas Bimba
Mar 23 at 4:46
add a comment |
I've done some changes in snapshot. Though I haven't verify as I don't have any Firebase database setup at my end as yours.
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
if snapshot.exists()
for snapChild in snapshot.children
if let user: Dictionary? = (snapChild as! DataSnapshot).value as? [String : AnyObject]
debugPrint("User uid: ", user!["uid"] as! String)
)
Replace your call with above code snippet and let me know if you are still having any issue.
Note: You can also improvisation you all user structure into model for better use.
I've done some changes in snapshot. Though I haven't verify as I don't have any Firebase database setup at my end as yours.
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
if snapshot.exists()
for snapChild in snapshot.children
if let user: Dictionary? = (snapChild as! DataSnapshot).value as? [String : AnyObject]
debugPrint("User uid: ", user!["uid"] as! String)
)
Replace your call with above code snippet and let me know if you are still having any issue.
Note: You can also improvisation you all user structure into model for better use.
answered Mar 22 at 5:43
Amir KhanAmir Khan
1,8391726
1,8391726
Hey, just seeing this. I am going to check it out and let you know.
– Lukas Bimba
Mar 22 at 18:55
I understand why you said that "var data = [String]()" is empty, yet it isn't. Imagine it has 2 uid strings within it and whats needed is a compare to "user" for matching UID's. Im posting code I was trying before. This code I am posted is not with your answer just my attempts.
– Lukas Bimba
Mar 23 at 1:31
With my added code, you'll see I compare the JSON string UID by doing "for uid in self.data"
– Lukas Bimba
Mar 23 at 1:35
Hey can you check out my update on your code? I matched the values but cannot save because "uid.jsonKey" is not a proper String.
– Lukas Bimba
Mar 23 at 4:44
I am currently trying some other methods of attack
– Lukas Bimba
Mar 23 at 4:46
add a comment |
Hey, just seeing this. I am going to check it out and let you know.
– Lukas Bimba
Mar 22 at 18:55
I understand why you said that "var data = [String]()" is empty, yet it isn't. Imagine it has 2 uid strings within it and whats needed is a compare to "user" for matching UID's. Im posting code I was trying before. This code I am posted is not with your answer just my attempts.
– Lukas Bimba
Mar 23 at 1:31
With my added code, you'll see I compare the JSON string UID by doing "for uid in self.data"
– Lukas Bimba
Mar 23 at 1:35
Hey can you check out my update on your code? I matched the values but cannot save because "uid.jsonKey" is not a proper String.
– Lukas Bimba
Mar 23 at 4:44
I am currently trying some other methods of attack
– Lukas Bimba
Mar 23 at 4:46
Hey, just seeing this. I am going to check it out and let you know.
– Lukas Bimba
Mar 22 at 18:55
Hey, just seeing this. I am going to check it out and let you know.
– Lukas Bimba
Mar 22 at 18:55
I understand why you said that "var data = [String]()" is empty, yet it isn't. Imagine it has 2 uid strings within it and whats needed is a compare to "user" for matching UID's. Im posting code I was trying before. This code I am posted is not with your answer just my attempts.
– Lukas Bimba
Mar 23 at 1:31
I understand why you said that "var data = [String]()" is empty, yet it isn't. Imagine it has 2 uid strings within it and whats needed is a compare to "user" for matching UID's. Im posting code I was trying before. This code I am posted is not with your answer just my attempts.
– Lukas Bimba
Mar 23 at 1:31
With my added code, you'll see I compare the JSON string UID by doing "for uid in self.data"
– Lukas Bimba
Mar 23 at 1:35
With my added code, you'll see I compare the JSON string UID by doing "for uid in self.data"
– Lukas Bimba
Mar 23 at 1:35
Hey can you check out my update on your code? I matched the values but cannot save because "uid.jsonKey" is not a proper String.
– Lukas Bimba
Mar 23 at 4:44
Hey can you check out my update on your code? I matched the values but cannot save because "uid.jsonKey" is not a proper String.
– Lukas Bimba
Mar 23 at 4:44
I am currently trying some other methods of attack
– Lukas Bimba
Mar 23 at 4:46
I am currently trying some other methods of attack
– Lukas Bimba
Mar 23 at 4:46
add a comment |
This works. Great Success!
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
if snapshot.exists()
for snapChild in snapshot.children
if let user: Dictionary? = (snapChild as! DataSnapshot).value as? [String : AnyObject]
let businessUID = user!["uid"] as! String
for uid in self.data
if uid == businessUID
let key = uid.description
print(key)
print("checking uid's")
let Ref = Database.database().reference().child("testing")
let saveUID = Ref.child(key).child("tested")
saveUID.setValue("String")
)
That's awesome!
– Amir Khan
Mar 23 at 5:03
add a comment |
This works. Great Success!
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
if snapshot.exists()
for snapChild in snapshot.children
if let user: Dictionary? = (snapChild as! DataSnapshot).value as? [String : AnyObject]
let businessUID = user!["uid"] as! String
for uid in self.data
if uid == businessUID
let key = uid.description
print(key)
print("checking uid's")
let Ref = Database.database().reference().child("testing")
let saveUID = Ref.child(key).child("tested")
saveUID.setValue("String")
)
That's awesome!
– Amir Khan
Mar 23 at 5:03
add a comment |
This works. Great Success!
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
if snapshot.exists()
for snapChild in snapshot.children
if let user: Dictionary? = (snapChild as! DataSnapshot).value as? [String : AnyObject]
let businessUID = user!["uid"] as! String
for uid in self.data
if uid == businessUID
let key = uid.description
print(key)
print("checking uid's")
let Ref = Database.database().reference().child("testing")
let saveUID = Ref.child(key).child("tested")
saveUID.setValue("String")
)
This works. Great Success!
Database.database().reference().child("Businesses").observe(.value, with: snapshot in
if snapshot.exists()
for snapChild in snapshot.children
if let user: Dictionary? = (snapChild as! DataSnapshot).value as? [String : AnyObject]
let businessUID = user!["uid"] as! String
for uid in self.data
if uid == businessUID
let key = uid.description
print(key)
print("checking uid's")
let Ref = Database.database().reference().child("testing")
let saveUID = Ref.child(key).child("tested")
saveUID.setValue("String")
)
answered Mar 23 at 4:49
Lukas BimbaLukas Bimba
221118
221118
That's awesome!
– Amir Khan
Mar 23 at 5:03
add a comment |
That's awesome!
– Amir Khan
Mar 23 at 5:03
That's awesome!
– Amir Khan
Mar 23 at 5:03
That's awesome!
– Amir Khan
Mar 23 at 5:03
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55293180%2fswift-firebase-match-uid-keys-with-a-array-of-uid-strings%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you attach your Firebase table of
allUsers
?– Amir Khan
Mar 22 at 5:08
What is it that you want to see? All you would see if the parent "Businesses" then the UIDs then the data that uid's hold
– Lukas Bimba
Mar 22 at 5:11
Yes what
allUsers
contains ? more precisely, the structure ofallUsers
.– Amir Khan
Mar 22 at 5:12
Just added it. Thats just a sample because it keeps going for a while lol
– Lukas Bimba
Mar 22 at 5:18
Got that. Thanks. Let me dig into this.
– Amir Khan
Mar 22 at 5:31