Skip to main content
Version: 1.0.0

Variants

Purpose​

The Variants collection contains detailed records for each product variant. Each document includes information such as color, size, codes, posters, 3D/AR model links (for both .glb and .usdz file formats), and references to related products, brands, and tags. This collection supports the management, configuration, and display of all available product variations.

Document schema​

{
"batch": "string",
"dataTaken": "boolean",
"eanCode": "string",
"frameColor": "string",
"glassesName": "string",
"id": "string",
"lastUpdate": "timestamp",
"lensesColor": "string",
"list_notes": ["string"],
"list_size_color_tags": ["string"],
"loadingId": "string",
"mainBrandRef": "string",
"mainModel": "boolean",
"modelPriority": "string",
"modelViewerUrl": "string",
"modify_model": {
"rejectCount": "number",
"requestCount": "number",
"status": "boolean"
},
"poster": "string",
"poster2": "string",
"poster3": "string",
"poster4": "string",
"posterNoBackground": "string",
"primaryFrameColorHex": "string",
"primaryLensesColorHex": "string",
"priority": "number",
"productRef": "string",
"secondaryFrameColorHex": "string",
"secondaryLensesColorHex": "string",
"size": {
"bridge": "string",
"frameWidth": "string",
"lensHeight": "string",
"lensWidth": "string",
"size": "string",
"templeLength": "string"
},
"skuModel": "string",
"status": "string",
"templeColor": "string",
"upcCode": "string",
"urlDE": "string",
"urlES": "string",
"urlFR": "string",
"urlGlobal": "string",
"urlGlobalComplete": "string",
"urlGlobalCompleteSize": "number",
"urlGlobalSize": "number",
"urlProductPage": "string",
"urlUsdz": "string",
"urlUsdzComplete": "string",
"urlUsdzCompleteSize": "number",
"urlUsdzSize": "number",
"variantCode": "string"
}

Indexes​

  • id is a string that refers to the specific ID of a document of this collection;
  • list_notes is a [] of strings that refer to the IDs of the ValidationNotes collection;
  • list_size_color_tags is a [] of strings that refer to the IDs of the Tags collection;
  • mainBrandRef is a string that refers to the ID of the MainBrands collection;
  • productRef is a string that refers to the ID of the Products collection.

Query examples​

// Fetch the Variant Reference Doc from Firebase
const variantRef = doc(db, "Variants", variantId);

// Get the Document Snapshot from the Variant Reference Doc
const variantDoc = await getDoc(variantRef);

// Query to fetch a variant by skuModel field
const variantBySku = query(collection(db, "Variants"), where("skuModel", "==", skuValue));