How do I fix 'INVALID reference' error for a foreign key (document reference) field in my database?

Resolved

I had a lot of data from a pre-FF version of my app. It includes Users, Items, and Posts.

Items have a single FK reference to Users. An item must be created by a User.

Posts have foreign key document references to both Users and Items. A post is for one Item and created by one User.

I was able to import all my data in Firestore. And I can see all 3 collections in FF.

The problem is I can only see the FK fields (user_id on Items, user_id and item_id on Posts) if I define them as type=String in FF. See first screenshot below.

If I change e.g. user_id from Type=String to Type=Document Reference I get an 'Invalid Reference' error. See second screenshot.

How can I resolve this problem? I think I need the FK fields in FF to be defined as Type=Document Reference for me to be able to access data from related collections, but stuck with this issue.

TIA for any advice.

PS: Here's what my item collection looks like in Firestore:

2
5 replies