Retrieve Firestore data in JS with OR operator?

I am attempting to read data from a Firestore collection using the following code:

auth.onAuthStateChanged(user => {
if(user) {
  console.log('User logged in:', user)

db.collection('MediCorePatientUsers').where("GPID", "==", user.email)
.get().then((snapshot) => {
    snapshot.docs.forEach(doc => {
        renderPatientList(doc);
        })
    })

document.getElementById("nameOfUser").innerHTML = user.email;

} else {
  console.log('User logged out');
}
});

This works as intended and displays the correct data. I am attempting to add another condition to the code using an ‘or’ operator to display data where the field “InsuranceCompany” is also equal to the current user email:

db.collection('MediCorePatientUsers').where("GPID", "==", user.email || "InsuranceCompany", "==", user.email)
.get().then((snapshot) => {
snapshot.docs.forEach(doc => {
    renderPatientList(doc);
    })
})

However, this is resulting in no data being displayed when either of the conditions is true. What is incorrect with this code?

The code is incorrect because the ‘or’ operator should be used to create a logical expression with two complete conditions. The correct code should be:

db.collection('MediCorePatientUsers').where("GPID", "==", user.email).orWhere("InsuranceCompany", "==", user.email)
.get().then((snapshot) => {
snapshot.docs.forEach(doc => {
    renderPatientList(doc);
    })
})

This uses the orWhere() method to add the second condition to the query, thus creating a complete logical expression.