I tried to update my firestore database field.
Future<void> approveJob(String categoryId) {
comment line is updated on database. But I hard code uid. Is it possible to get uid without store?
//return _db.collection('jobs').document('25FgSmfySbhEPe1z539T').updateData({'isApproved':true});
return _db
.collection('jobs')
.where("categoryId", isEqualTo: categoryId)
.getDocuments()
.then((v) {
try{
v.documents[0].data.update('isApproved', (bool) => true,ifAbsent: ()=>true);
// No Errors. But not updating
}catch(e){
print(e);
}
});
}