What are naming conventions for MongoDB?

后端 未结 6 1064
梦如初夏
梦如初夏 2020-12-22 15:47

Is there a set of preferred naming conventions for MongoDB entitites such as databases, collections, field names?

I was thinking along these lines:

  • Dat
6条回答
  •  天命终不由人
    2020-12-22 16:28

    I think it's all personal preference. My preferences come from using NHibernate, in .NET, with SQL Server, so they probably differ from what others use.

    • Databases: The application that's being used.. ex: Stackoverflow
    • Collections: Singular in name, what it's going to be a collection of, ex: Question
    • Document fields, ex: MemberFirstName

    Honestly, it doesn't matter too much, as long as it's consistent for the project. Just get to work and don't sweat the details :P

提交回复
热议问题