Profiles
Purpose
The Profiles collection defines the structure of user profiles. Its purpose is to store authentication data, access role, catalog associations, and user preferences.
Document schema
{
"_email": "string",
"accountCreationDate": {
"__time__": "timestamp"
},
"avatarURL": "string",
"canPlaceOrders": "boolean",
"catalogsList": ["string"],
"clientRef": "string",
"firstName": "string",
"lastName": "string",
"orderList": ["any"],
"ref_log_access": "string",
"role": "string"
}
Indexes
- catalogsList is a
[]ofstrings that refer to the IDs of theCataloguescollection - orderList is a
[]ofstrings that refer to the IDs of theCataloguesOrderscollection - clientRef is a
stringthat refers to the ID ofClientcollection;
Query examples
// Fetch the Reference Doc from Firebase
const profileRefDoc = doc(db, "Profiles", profileId);
// Get the Document Snapshot from the Reference Doc
const profileRefSnap = await getDoc(profileRefDoc);