'Query firestore array of objects

I have firestore collection events.

Every event have date which is array of objects with two strings, startTime and endTime.

enter image description here

Is it possibile to retrive every events which have at list one startTime which is bigger than current time?



Solution 1:[1]

You can get the whole document by querying firebase with "array-contains", but you must search for the exact properties of the object and the exact object itself. In your case "endTime" and "startTime".

firebase.firestore.collection('events').where("date", "array-contains", {endTime: "March 18 ....", startTime: "March 19 ...."})

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Pipera