sqltabs icon indicating copy to clipboard operation
sqltabs copied to clipboard

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

Open kuamatzin opened this issue 5 years ago • 3 comments

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

kuamatzin avatar May 29 '20 00:05 kuamatzin

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

sasha-alias avatar May 29 '20 06:05 sasha-alias

@kuamatzin You can select like below:

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

donaldnguyen83 avatar Aug 20 '20 15:08 donaldnguyen83

@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()

jpacareu avatar Oct 21 '20 23:10 jpacareu