Last active
May 1, 2018 23:48
-
-
Save ryanmats/66ea48d6838bcb587d5eba27a731a474 to your computer and use it in GitHub Desktop.
AddData1 - Original
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) | |
{ | |
FirestoreDb db = FirestoreDb.Create(project); | |
// [START fs_add_data_1] | |
DocumentReference docRef = db.Collection("users").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