Query firestore database for document id

后端 未结 6 690
梦毁少年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条回答
  •  长情又很酷
    2020-12-01 04:07

    Just to clear confusion here

    Remember, You should use async/await to fetch data whether fetching full collection or a single doc.

    async function someFunction(){
     await db.collection('books').doc('fK3ddutEpD2qQqRMXNW5').get();
    }
    

提交回复
热议问题