favorites page: displaying firestore docs in a collection from references in another

In my scenario, I am trying to have users add things (birds) as favorites, and then go to a page in their profile to see the list of birds they've marked as a favorite.

I have the part of adding to favorites working. I do it with a ToggleIcon widget that adds a reference for a document in the birds collection a List field in the users document. That works when toggling the icon, the reference gets added/removed.

Now I am building a page in the user profile to show the list of birds they've added as favorites and I can't get it to work. I thought I could add a backend query to the page for the users collection, then a backend query to the listview for the birds collection, and filter with the "in" condition, like this: [birds document] "in" [users favorite_birds field].

Hopefully that makes sense.

The firestore is like this in case it helps understand what I'm trying to do.

Birds
 -name, string
 -region, string
 -etc....

Users
 -email, string
 -name, string
 -fav_birds, List<Doc Reference (Birds)>

When I try to setup the query for the listview and filter it, it doesn't work.

Here, I can't user something like "reference" instead of display_name so I can use it to match the "in" relation to the fav_birds list field.

Thanks for any pointers!

7 replies