I have a list with the following data: (List of halls, every hall has some events that start at a given time and end at a different time)
{
name: "hall 1"
events: [
{
name: "React lecture",
startAt: 1500225422,
endAt: 1500226422
}
]
}, {
name: "hall 2"
events: [
{
name: "Angular lecture",
startAt: 1500227422,
endAt: 1500228422
}
]
}
I would like to query all of the events, and their halls, to see what event is currently happens and where.
Given a current timestamp (lets say 1500225556
), I would like to get:
{
name: "hall 1"
events: [
{
name: "React lecture",
startAt: 1500225422,
endAt: 1500226422
}
]
}
If necessary, I can flatten this a bit, and have a list of halls, and a list of events with a reference to the hall they take place at.
SQL equivalent (list):
WHERE startAt < 1500225556 AND endAt > 1500225556
I cannot think of a solution without a custom cloud function.