Yes, you can query a field using type as ‘Reference’ in Firestore. Reference is a supported data type by Cloud Firestore as in documentation. Within a project, references can point to any other document in any other collection. You can use references in queries like any other value: for filtering, ordering, and for paging (startAt/startAfter).
Considering a simple example,there are two collections: collection A and collection B. We would like to find out all the docs of Collection A/PQR which is referring to some very specific document Collection B/WJH. Here, we can use Reference that points to the document in Collection B and then use a where clause to filter data on the reference value of Collection A.
Using Javascripts here:
// Create a reference to the specific document you want to search with:
var reference = db.collection("Collection B").doc("WJH");
// Construct a query that filters documents matching the reference:
var query = db.collection("Collection A").where("reference", "==", reference);
You may also refer to a similar Stackoverflow case.