I am currently fetching notifications from a google firebase realtime db collection based on a users id. I also need to filter the snapshot to ensure that only notifications created in the last 7 days are returned. Would appreciate any help
export const getNotifications = async (uid) => {
const fb = new Firebase();
const notifSnap = await fb.notifications().orderByChild('user_id').equalTo(uid).once('value');
return notifSnap?.val() || {};
};
Have been testing for a bit.