L
L
lordning9992021-06-14 16:25:31
firebase
lordning999, 2021-06-14 16:25:31

React Native Firestore display user posts, how?

Hello everyone, tell me guys, there is a chat between users - user = user.
How to display messages when entering the room, for example, there is Sasha and Misha, Sasha enters, his and Misha's messages are displayed, when Misha enters, Misha's and Sasha's messages are displayed, tell me how to do this.

Here is what I tried

firestore()
.collection('messages')
.where('user_id', '==', parseInt(data.user_id))
.where('to_uid', '==', parseInt(data.to_uid))
.get()


But this method only works for 1, but what about the second? If the work was with mysql, then it’s clear, there is a selection of two fields at once, comparison operators and everything is ok, but how is it here? I didn't find anything in the documentation about this. I'll be happy to help, thanks :)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question