Home > Software design >  Name Firestore and Realtime Database fields
Name Firestore and Realtime Database fields

Time:07-23

I have seen a lot of people using "accountName" but some people are using "account_name", Currently I think it makes more sense with "account_name" because it's not a variable it's just a field and it's more clear when I read a ton of string.

Is there any standard or specification for the NoSQL database fields name? If not which one do you prefer?

CodePudding user response:

You can name your fields whatever you want but remember, Firebase always tries to map between the properties in the JSON data from the Realtime Database and the properties that exist in your classes using JavaBean naming conventions.

So according to the JavaBean property pattern, it makes more sense to use accountName rather than account_name.

  • Related