[BUG] Can't use a flatten fields as Reference field

Hi.
Its seems that we can select a flatten field as a reference field but it’s not displayed unless the related “object” as been opened once.


image

(after a click on the first card and a refresh of the list, by clicking on the search field and pressing enter the reference field is correctly displayed)
image

Yes I’ve just been scratching my head a lot today trying to figure out a way to make it work but it’s simply impossible. The problem is also breaking the exports, the flattened fields appear as JSON.stringify'd objects.

I tried a smart field, but nope, returning the id in the get function does the same. I suspect flattened fields are handled the same as smart fields under the hood, being simple get and set functions.

I ended up using my custom library that transforms the query object to query mongodb in my own controllers, but I’d love to be able to rely on the built-ins for such basic things. Quite frustrating.

I’m using the following version: "forest-express-mongoose": "^8.4.0", and just tried with 8.4.4 but the problem still persist.