ForestAdmin / forest-express-mongoose

🌱 ExpressJS/Mongoose agent for Forest Admin to integrate directly to your existing ExpressJS/Mongoose backend application.
https://www.forestadmin.com
GNU General Public License v3.0
193 stars 28 forks source link

How can I define a field with select box? #142

Closed tan-nguyen-synova closed 5 years ago

tan-nguyen-synova commented 5 years ago

I want to render fields such as gender, status as string while these fields are stored in mongoDB as Number. Ex: gender is stored in DB with value: 1 | 2 and render as "Male" | "Female". Thank you!

arnaudbesnier commented 5 years ago

Hi @tan-nguyen-synova,

You can do that and I think the answer to your question is in the documentation. You can decorate your fields in ForestAdmin UI with what we call widgets.

In your case you could use the dropdown or Radio button: https://docs.forestadmin.com/documentation/reference-guide/fields/customize-your-fields/edit-widgets#dropdown

Let me close the issue but feel free to reopen it if you cannot manage to do it with the documentation.