Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

equal_to() method gets the whole document instead of the parent only #50

Open
sayrilkun opened this issue Apr 4, 2022 · 0 comments
Open

Comments

@sayrilkun
Copy link

I have this structure:

-User:
     -user1:
              -name : cycy
              -email: [email protected]

What I intend to do is know what parent does the input email contains. for example if my input email is [email protected], I should be able to output "user1". Here is my code:

hey = db.child("User").order_by_child("email").equal_to("[email protected]").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: [email protected]})])

How can i modify this so that it only gives the parent "user1"

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant