I have an application where the users can create their own events with a start and end timestamp. The problem now is that Firestore not supporting to make a query on two different fields, so I can't search directly like .where('start','<', endOfDay).where('end',>, startOfDay)
. Btw important is I need to query between two timestamps and not only around one timestamp. The existing question Firestore query by date range will not solve this problem because in that question is only one timestamp!
My goal is that a user can get all events which he has on the current day. As an example, I want to get all events on the red marked day in the following picture.
The only solution, which I currently think is possible, is to split the timespan and put it in an array. As example, an event 1-3 March 2022 will look like ['2022-3-1','2022-3-2','2022-3-3']
where I can make the query then like this .where('days', 'array-contains', '2022-3-2')
. But this solution is hideous because I have a lot more storage costs and the user download always more data than he needs.