f-miyu / Plugin.CloudFirestore

MIT License
121 stars 44 forks source link

Is there any way to Create a Document with predefined ID #34

Open sobby01 opened 4 years ago

sobby01 commented 4 years ago

I want to store User Profile Data with the User ID which I created after Facebook authentication.

  1. I logged in into FB through Firebase and and then access the ID.
  2. Using that ID, I want to create a document for the profile.

Using the plugin I can call CreateDocument which works for Auto GUID. Is there any way to provide predefined ID.

f-miyu commented 4 years ago

You should use GetDocument if document id is predefined.

await CrossCloudFirestore.Current
                         .Instance
                         .GetCollection("collection")
                         .GetDocument("predefinedID")
                         .SetDataAsync(new { Value = 1 });
sobby01 commented 4 years ago

Hey, It worked like a charm. Working fine

Thank you so much.