Query firestore database for document id

后端 未结 6 666
梦毁少年i
梦毁少年i 2020-12-01 03:09

I want to query a firestore database for document id. Currently I have the following code:

db.collection(\'books\').where(\'id\', \'==\', \'fK3ddutEpD2qQqRMX         


        
6条回答
  •  -上瘾入骨i
    2020-12-01 03:52

    Try this:

    db.collection('books').doc('fK3ddutEpD2qQqRMXNW5').get()
    

    (The first query is looking for an explicit user-set field called 'id', which probably isn't what you want.)

提交回复
热议问题