잘 짠 코드인지는 의문이 들고 있으나 .where() 연달아 붙이는 방식으로 해결했습니다
async function checkOverlap() {
const dbData = db
.collection("chatroom")
.where("who", "array-contains", state.userUid)
.where("product", "==", data.상품명)
.get();
const result = await dbData;
console.log(result);
if (result.size === 0) {
db.collection("chatroom")
.add({
who: [state.userUid, data.uid],
date: new Date(),
product: data.상품명,
})
.then(() => {
console.log("새로운 채팅방 개설 성공!");
navigate(`/chat/${state.userUid}`);
});
} else {
console.log("이미 개설된 채팅방이 있습니다");
navigate(`/chat/${state.userUid}`);
}
}