The short answer is that you cannot achieve this in Firestore. You cannot query your database for all the cars regardless of which transportation contained them.
But in such cases, there is a workaround in which you should change your database structure a little bit by creating a new top-level collection named cars
in which you should add all your car
objects. Beheath each car
object you'll also should add the desired transportation
as a property. In this way you'll be able to query the database according to your needes.
Your database structure should look like this:
Firestore-root
|
--- cars (collection)
|
--- carId (document)
|
--- transportation: "Private Taxi"
|
--- //other car details