Skip to main content
Version: 1.0.0

Sessione_WebVto

Purpose​

The Sessione_WebVto collection records Web VTO sessions, including device information, timestamps, references to catalogs/lines/models, and details of tried glasses.

Document schema​

{
"data_fine_user_session": "string",
"data_inizio_sessione": "string",
"device": "string",
"device_id": "string",
"device_os": "string",
"glassesRefs": ["string"],
"glassesSize": ["string"],
"is_first_session": "boolean",
"lineaRefs": ["string"],
"lista_occhiali_visualizzati": [
{
"date": "timestamp",
"glassesRef": "reference",
"lineaRef": "reference",
"listaModelliProvati": [
{
"lastUpdate": "timestamp",
"modelRef": "reference",
"tagliaRef": "reference",
"timeStart": "timestamp",
"totalSeconds": "number"
}
],
"nome_occhiale": "string",
"totalSeconds": "number"
}
],
"modelRefs": ["string"],
"ref_catalogo": "reference",
"referral": "string",
"total_time": "number"
}

Indexes​

glassesRefs is a [] of strings that refer to the IDs of the Occhiale collection; glassesSize is a [] of strings that refer to the IDs of the Taglia collection. lineaRefs is a [] of strings that refer to the IDs of the Linea collection; lista_occhiali_visualizzati.glassesRef is a reference of the Occhiale collection; lista_occhiali_visualizzati.lineaRef is a reference of the Linea collection; listaModelliProvati.modelRef is a reference of the Modello collection; listaModelliProvati.tagliaRef is a reference of the Taglia collection; modelRefs is a [] of strings that refer to the IDs of the Modello collection; ref_catalogo is a reference to the Brand collection.

Query examples​

// Get a single 3D viewer session
const sessionRef = doc(db, "Sessione_WebVto", sessionId);
const sessionSnap = await getDoc(sessionRef);

// Query sessions for a specific brand
const catalogSessions = query(
collection(db, "Sessione_WebVto"),
where("ref_catalogo", "==", brandRef)
);

// Query sessions for a specific glasses reference
const glassesSessions = query(
collection(db, "Sessione_WebVto"),
where("glassesRefs", "array-contains", glassesId)
);

// Query sessions including a specific line
const lineSessions = query(
collection(db, "Sessione_WebVto"),
where("lineaRefs", "array-contains", lineRef)
);

// Query sessions including a specific model
const modelSessions = query(
collection(db, "Sessione_WebVto"),
where("modelRefs", "array-contains", modelRef)
);