Created
October 1, 2021 15:11
-
-
Save vijayinyoutube/872477731c163169fbcfd3d8f30852ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<void> addField() { | |
return collectionRef | |
.doc('MyDoc') | |
//will edit the doc if already available or will create a new doc with this given ID | |
.set( | |
{'role': "developer"}, | |
SetOptions(merge: true), | |
// if set to 'false', then only these given fields will be added to that doc | |
) | |
.then((value) => debugPrint("User Added")) | |
.catchError((error) => debugPrint("Failed to add user: $error")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment