Skip to main content
Version: 1.0.0

Data_Consumption

Purpose​

The Data_Consumption collection defines the structure for storing information about files consumed or generated in ARShades.
Its purpose is to track metadata such as file name, size, storage location, and the instance that produced or used the file.

Document schema​

{
"fileName": "string",
"fileSizeInBytes": "number",
"fileUrl": "string",
"instanceId": "string",
"instanceType": "string"
}

Indexes​

  • instanceId is a string that refers to the ID of Variants collection;

Query examples​

// Fetch the Reference Doc from Firebase
const dataConsumptionRefDoc = doc(db, "Data_Consumption", dataConsumptionId);
const dataConsumptionSnap = await getDoc(dataConsumptionRefDoc);

// Query all files for a specific instance (variant)
const filesByInstance = query(
collection(db, "Data_Consumption"),
where("instanceId", "==", variantId)
);

// Query by instance type
const filesByType = query(
collection(db, "Data_Consumption"),
where("instanceType", "==", "Modello")
);