It should be
import { collection, query, where, getDocs, getFirestore } from '@react-native-firebase/firestore'
Checkout the docs: https://rnfirebase.io/migrating-to-v22