Skip to main content
Version: 1.0.0

Sessione_Visualizzatori3d

Purpose​

The Sessione_Visualizzatori3d collection stores analytics and usage sessions of the 3D AR Viewer.
It tracks devices, session duration, consumed bandwidth, glasses and models tested, and references to catalogues, lines, and sizes.

Document schema​

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

Indexes​

glassesRefs is a [] of strings that refer to the IDs of the Occhiale collection; glassesRefsDoc is a string that refers to the ID of the Occhiale collection; glassesSize is a reference to the Taglia collection. lineaRefs is a [] of references of the Linea collection; lista_occhiali_visualizzati.glassesRef is a string that refers to the ID 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 references 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_Visualizzatori3d", sessionId);
const sessionSnap = await getDoc(sessionRef);

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

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

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