Answers for "get one document based on id in firestore"

2

get one document based on id in firestore

//retrieve one document and save it to userDetails
const [userDetails, setUserDetails] = useState('')
db.collection('users').doc(id).get()
        .then(snapshot => setUserDetails(snapshot.data()))
Posted by: Guest on June-28-2020

Code answers related to "get one document based on id in firestore"

Browse Popular Code Answers by Language