SoftwareBrothers / adminjs-mongoose

Mongoose adapter for AdminJS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mongoose array discriminators do not render properties from the discriminated objects

maxpeterson opened this issue · comments

As far as I can tell this mongoose adapter does not include any support for Mongoose discriminators.

Is there a plan to add support for discriminators?
If not is there any interest in contributions towards adding support for discriminators?

The discriminator mapping (discriminatorKey) along with the property information for each discriminator type could be extracted from the Mongoose schema and stored on the Property.

Once available in the adminjs frontend the full set of properties could be determined using the discriminatorKey value for a recored.

Hello, do we have any status regarding this ?

I would need more details on how you would like this to be implemented as I don't work with Mongoose much. Displaying different fields dynamically based on what's selected as discriminatorKey might be impossible with how AdminJS is structured because adapters cannot access data in the frontend.