Created
May 1, 2018 23:59
-
-
Save ryanmats/84744aa4210d8317042ab24586e7ada4 to your computer and use it in GitHub Desktop.
AddData1 - New
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
private static async Task AddData1(string project, string usersCollectionId) | |
{ | |
FirestoreDb db = FirestoreDb.Create(project); | |
// [START fs_add_data_1] | |
DocumentReference docRef = db.Collection(usersCollectionId).Document("alovelace"); | |
Dictionary<string, object> user = new Dictionary<string, object> | |
{ | |
{ "First", "Ada" }, | |
{ "Last", "Lovelace" }, | |
{ "Born", 1815 } | |
}; | |
WriteResult writeResult = await docRef.SetAsync(user); | |
Console.WriteLine(writeResult.UpdateTime); | |
// [END fs_add_data_1] | |
Console.WriteLine("Added data to the alovelace document in the users collection."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment