I have a collection of documents in a Firestore database. All the documents have a field named "debtorEmail", but only some of them have also a field named "creditorEmail". I want to read all the documents in which "creditorEmail" is absent. According to Firestore documentation:
const notCapitalQuery = query(citiesRef, where("capital", "!=", false));
This query does not return city documents where the capital field does not exist. Not-equal (!=) and not-in queries exclude documents where the given field does not exist.
My code is as follows:
const docCollection = collection(db, "requests");
const dataSection = document.getElementById("data-section");
const qRequests = query(docCollection, where("creditorEmail", "!=", false));
but this query delivers precisely those documents in which creditorEmail exists. If I change "false" by "true" the query delivers the same results. It is as if the "!=" condition does not work. Does anybody have any idea of what is wrong?