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

How to get a document by document id in google firestore? #145

Open
kuamatzin opened this issue May 29, 2020 · 3 comments
Open

How to get a document by document id in google firestore? #145

kuamatzin opened this issue May 29, 2020 · 3 comments

Comments

@kuamatzin
Copy link

Hi, I would like to know how to get a specific document in google firestore by id

@sasha-alias
Copy link
Owner

Hi, I don't think it's possible atm. Only collection instances can be displayed.
Probably it deserves to be implemented one day.

@donaldnguyen83
Copy link

@kuamatzin You can select like below:

collection('your_collection')
    .where('__name__', '==' , 'your_document_id')
    .select();

@jpacareu
Copy link

@kuamatzin You can select like below:

collection('your_collection')
    .where('__name__', '==' , 'your_document_id')
    .select();

Yep this one worked well for me:

collection("users").where("__name__", "==" , "USER_ID_HASH").select()

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

4 participants