I am facing an issue where I can only retrieve the values I need from the array by adding a specific string like "اقلام" or "سبورة". However, I want the value to be passed as a prop from another component or screen. Is there a way to resolve this problem?
https://i.stack.imgur.com/dqmST.png
const fetchCategoryProducts = (catId)=>{
const categoryProductsCollection = query(collection(db, "Product"), where("categories", "array-contains", catId))
const getCategoryProducts = getDocs(categoryProductsCollection);
const categoryProducts = (await getCategoryProducts).docs.map(item=>{
const data = item.data();
data.id = item.id;
return data
})
console.log(categoryProducts) // encountering empty array in the output
}}