Open sayrilkun opened 2 years ago
I have this structure:
-User: -user1: -name : cycy -email: cycy@test.com
What I intend to do is know what parent does the input email contains. for example if my input email is cycy@test.com, I should be able to output "user1". Here is my code:
hey = db.child("User").order_by_child("email").equal_to("cycy@test.com").get() print(hey.val())
My problem with this code is that it outputs everything and not the parent "user1" only OrderedDict([('user1', {'name: cycy, email: cycy@test.com})])
OrderedDict([('user1', {'name: cycy, email: cycy@test.com})])
How can i modify this so that it only gives the parent "user1"
Thank you!
I have this structure:
What I intend to do is know what parent does the input email contains. for example if my input email is cycy@test.com, I should be able to output "user1". Here is my code:
My problem with this code is that it outputs everything and not the parent "user1" only
OrderedDict([('user1', {'name: cycy, email: cycy@test.com})])
How can i modify this so that it only gives the parent "user1"
Thank you!