How to check all documents in a collection for a value firestore reactjs

Here is my code:

function loginHandler() {

        firestore.collection("users").forEach(user => {
            if (user.username === queryUsername && user.password === queryPassword) {
                navigate("/");
            }
            else {
                setMode("INCORRECT")
            }
        })

    }

I am trying to check if a doc in the users collection of my firestore db has the username property of the queryUsername and the password property of the queryPassword.
When I run this function:

function loginHandler() {

            if (firestore.collection("users").doc("doc that definetly doesnt exist")) {
                console.log("exists")
            }
            else {
                console.log("doesnt exist")
            }

    }

It logs exists for some reason