Skip to main content
Version: 1.0.0

Lista_Notification

Purpose​

The Lista_Notification collection stores the relationship between a user (account) and a specific notification.
Its purpose is to track whether a notification has been delivered, read, and its current status.


Document schema​

{
"accRef": {
"__ref__": "Profile/{profileId}"
},
"notificheRef": "string",
"readTime": "timestamp|null",
"sendTime": "string (ISO date)",
"status": "string"
}

Indexes​

  • accRef is a reference to a document in the Profile collection;
  • notificheRef is a string referencing the ID of a document in the Notifications collection.

Query examples​

// Fetch a specific notification status for a user
const listaNotificationRef = doc(db, "Lista_Notification", listaNotificationId);
const listaNotificationSnap = await getDoc(listaNotificationRef);

// Query all unread notifications for a user
const unreadNotifications = query(
collection(db, "Lista_Notification"),
where("accRef", "==", doc(db, "Profile", profileId)),
where("status", "==", "unread")
);

// Query by notification reference
const byNotificationRef = query(
collection(db, "Lista_Notification"),
where("notificheRef", "==", notificationId)
);