79502871

Date: 2025-03-12 07:24:15
Score: 1
Natty:
Report link

For anyone landing on this you need to put the collection inside of query as well when using getDocs I believe.

import { collection, getDocs, query } from 'firebase/firestore'; 
        
const q = query(collection(db, 'incidents'), where('assignedUsers', 'array-contains', userStore.userId));
const querySnapshot = await getDocs(q);
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: user2826751