Skip to main content
Version: 1.0.0

Mirror

Purpose​

The Mirror collection defines the configuration of a smart mirror experience inside the ARShades platform.
Its purpose is to store metadata, branding, and media resources (logo, videos, orientation) associated with a mirror setup.

Document schema​

{
"PP_logo": "string",
"brands": ["reference"],
"name": "string",
"orientation": "string",
"takePhotoNumber": "number",
"videoUrlLandscape": "string",
"videoUrlPortrait": "string"
}

Indexes​

  • brands is a [] of references to the Brand collection.

Query examples​

// Fetch the Reference Doc from Firebase
const mirrorRefDoc = doc(db, "Mirror", mirrorId);
const mirrorSnap = await getDoc(mirrorRefDoc);

// Query mirrors by brand
const mirrorsByBrand = query(
collection(db, "Mirror"),
where("brands", "array-contains", doc(db, "Brand", brandId))
);

// Query mirrors by orientation
const mirrorsByOrientation = query(
collection(db, "Mirror"),
where("orientation", "==", "landscape")
);