Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Abstract

This page mainly covers the design of the new data models of the Dashboard under Mongoose. This new model should provide a more extendable data storage for the OpenMRS ID.

The goals for this data model is in-line with the Dashboard, that is to provide a one-site service.

For now they're only the most basic one that could cover the old data.

Will Be Updated

User

I'll just paste my code simply just write some specifications here.

Code Blocklanguagejs

This is only for the database level

Code Block
linenumberstrue
var userSchema = new Schema({
  /// user Schema
username: String,<String> // not empty, unique, usernameonly contain number and characters, firstName:currently String,at least has lastName:a String,length of 2
displayNamefirstName: String,<String> // not firstNameempty,
+lastName: '<String> '// +not lastNameempty,
bydisplayName: default<String> // not empty,
primaryEmail: String,<String> // Used for notifications
 not empty, unique, valid email address, one of emailList
displayEmail: String,<String> // Usedvalid foremail displayingaddress
  emailList: < [String], > // All the users' Emails

  password: String,  //hashed password
}); array of valid email address, not empty, all members are unique
password: <String> // not empty, a hashed String