What is the difference between the 'value' Document reference and document ID?

Database & APIs

Are document reference 'values' unique? I assume document IDs are unique meaning that at least in the same collection no two documents may have the same ID.

I would like to use document references in building logic and not document IDs. An example is in the attached screenshot where I say that an action is conditional upon: User Record Reference of the authenticated user is not equal to a document reference in a collection (not users collection) that references some users. [The use case is that if a user joined an event, his record reference gets written in that collection in a field with type document reference to be able to retrieve his info later on, so I am saying that allow a user to join so long as he hasn't joined already].

Screenshot 2024-09-16 at 13.12.07.png
2.73MB

I don't or I can't use document IDs for this purpose, simply because I don't have access to them since I am only reading the collection that contains fields for user references.

Cn I do that? or do I have to use IDs, the access to which will only be possible if I read all documents from references stored in the fields of the original collection (12 read actions, crazy!)

And if I can do that, I need to initialize all the fields containing references to users which would otherwise remain empty untill a user joins in the respective spot. The reason I must initialize them is that I have queries on those references placed on widgets in some pages and until a user joins i get a red screen error for null check. To initialize, I will create a dummy user (for empty spot), and I am hoping to know its 'user reference' "value" or "number" to put it all tchnically empty spots untill they get overwritten and place all necessary logic.

How can I find the "user reference value or number" of that dummy user (or any user)? Is it the document ID?

Thanks

What have you tried so far?

I tried building the logic with references (as values to compare to) and not with IDs. But I am not sure if references are unique as IDs should be and if my method will cause me trouble later.

Did you check FlutterFlow's Documentation for this topic?
Yes
4 replies