I don’t quite understand your question but I’ll try to answer.
Primary key can be informed by you or can be generated by Firebase.
To enter a record stating the key: db.Collection("users"). doc("my user’s key"). set(objectComInformationDoUsuario);
To enter a record without entering the key (key is generated by Firebase): db.Collection("users"). doc(). set(objectComInformationDoUsuario); In this case, the return of this method will be an object containing, among other things, the key created.
To update the registry you need the key. To get the key: var referenceDoUsuario = db.Collection("users"). doc("my user’s key");
With that in hand, just do referenceDoUsuario.update({ name: "User name" })
Note: I don’t know on which platform you are developing. I used as a basis the web (Javascript).
Documentation: https://firebase.google.com/docs/firestore/manage-data/add-data