Closed robertmaxted closed 3 years ago
I'd like to be able to use the AddAsync to add a new doc to a collection with the doc ID being the ID I choose. Below is an example:
`var businessNumber = new BusinessNumberNameModel() { Id = BusinessID, Business_Name = BusinessName };
await CrossCloudFirestore.Current .Instance .Collection("business_ids") .AddAsync(businessNumber); Console.WriteLine(businessNumber);`
When I do the above the new doc in firebase cloud firestore has an auto ID..
How do I add a doc with a specific doc ID?? Any advice or a fix would be greatly appreciated. Kind regards, Rob
@f-miyu
https://stackoverflow.com/questions/48541270/how-to-add-document-with-custom-id-to-firestore
Need to use Set instead of Add for specific Doc Ids
I'd like to be able to use the AddAsync to add a new doc to a collection with the doc ID being the ID I choose. Below is an example:
`var businessNumber = new BusinessNumberNameModel() { Id = BusinessID, Business_Name = BusinessName };
When I do the above the new doc in firebase cloud firestore has an auto ID..
How do I add a doc with a specific doc ID?? Any advice or a fix would be greatly appreciated. Kind regards, Rob
@f-miyu