0

I'm working on an app that will function similar to a dating app (though different purpose) and working on filtering out users from the firestore query that they have already liked or disliked, but cant seem to figure find a not operator for the where.

Currently my database is structured with a collection of profiles. Each profile document has a like and dislike field that is an array. When lets say Person-A likes Person-B, then Person-A's documentID is added to Person-B's likes array (same process for dislikes).

How can I structure the where clause to exclude the profiles that have already been interacted with?

_firebaseService.db.collection('profiles').where(????).snapshots()
DRing
  • 6,825
  • 6
  • 29
  • 45
  • 1
    Short answer: you can't. Long answer: read the duplicate for alternatives. – Doug Stevenson Apr 02 '20 at 21:16
  • I don't think there is a clean way of doing this other than manual solutions. but you can save user interacted inside your user array and when another user pops up check if array-contains that id which checks if the two users have interacted, if true skip it, the problem is this always reruns every user from 0, or you can index and shuffle your users it might work. – Henok Apr 02 '20 at 21:17
  • Thanks Doug, I was leaning towards that solution of the overscan, but wanted to make sure I wasnt missing something before I committed to it – DRing Apr 02 '20 at 21:26

0 Answers0