Reputation: 4141
I have an app with user
s in a database, like this:
user
first_name
: stringlast_name
: stringheight
: integereye_color
: ????The eye_color
element is confusing me, because I want to have a finite selection (i.e. users can never select "red" for eye_color
).
Maybe I even want richer content in eye_color
s, such as:
eye_color
color
: bluehex
: 000080description
: "Like the ocean."That way, in my app, I could render a user's avatar with user.eye_color.hex
What's the proper way to accomplish this?
Thanks!
Upvotes: 0
Views: 355
Reputation: 317362
Firestore does not have an enumeration type. If there are limits to what values should be in the database, you have to control that on your own. Security rules will help you validate data coming from mobile clients.
Upvotes: 2