Using the model below, I need to use the where
operator when querying Firestore. However, the where
attribute is nested based on the following variable code:
where("category", "==", "Something"),
const language = "EN" { EN: { category: "Something in english" }, FR: { category: "Something in french" } }
To be able to query a collection based on the values present in the map, you should use the
where
function call like this:If you need to change the language, then you should consider using variables instead of hard-coded values. In code it should look like this: