Afonso Salvador
Afonso Salvador

Reputation: 65

How to make a query that uses != in firestore

I tried to make my query as it is in the code below but apparently the condition != does not work in firestore react native, can someone give me a hand ?

const getUsers = async () => {
        const querySnap = await firestore().collection('users').where('email', '!=', user.email).get()
        const allUsers = querySnap.docs.map(docSnap => docSnap.data())
        console.log(allUsers)
        setUsers(allUsers)
    }

Upvotes: 0

Views: 46

Answers (1)

Farid Shumbar
Farid Shumbar

Reputation: 1420

As @FrankvanPuffelen mentioned, the error may be related to your SDK version that doesn't support the != operator.

Try updating the SDK in order to solve the issue.

Upvotes: 1

Related Questions