Skip to content

Latest commit

 

History

History
141 lines (129 loc) · 16.1 KB

database.md

File metadata and controls

141 lines (129 loc) · 16.1 KB

This page introduces the database design.

Role Collection

name type default max length min length required unique regex description
name string 80 true name of the role
description string 255 description of the role

User Collection

name type default max length min length required unique regex description
name string 255 display name of user
email email 255 true true user email
password string 255 user password
active boolean true user active or not
complete boolean false user's profile complete or not
confirm_at datetime time of user email confirmation
roles list (reference:Role) [] roles list of user
last_login_at datetime last login time
current_login_at datetime current login time
last_login_ip string 255 last login ip
current_login_ip string 255 current login ip
login_count int login times count
username string 50 false true currently generated by name field
remember_token string 255 remember login token
authentication_token string 255 authentication token
tagline string 255 user short tagline
bio string user long self-introduction
links list (embedded: UserLink) user social networking external links
use_avatar_from string upload choices between (gravatar, url, upload and facebook)
gravatar_email email 255 for choice gravatar
avatar_file_path string for choice upload
avatar_url string 255 for choice url
teach_langs list (embedded: LanguageItem) [] languages user teaches
learn_langs list (embedded: LanguageItem) [] languages user learns
location embedded: Location location type & location coordinate
place reference: Place place document
birthday datetime true use birthdate to generate virtual property age
gender string unknown true choices between (male, female, unknown)
settings embedded: UserSetting pre-configured object user settings
learn_points embedded: LearnPoint pre-configured object user learn record
nationality string true country name
partners list (objectid) [] list of added partners

Language Item

name type default max length min length required unique regex description
language_id string 10 true full name for display(e.g. English)
level int 0 true language level

Location

name type default max length min length required unique regex description
type string Point location type, choices between (Point, Polygon, LineString)
coordinates list (double) [] an array of points

Place

name type default max length min length required unique regex description
country_code string 5 true country abbrev
country string 50 true country name
place_type string city 20 choices between (city, region)
location embedded: Location location embedded object
full_name string 100 place name, country name
name string 50 place name

User Setting

name type default max length min length required unique regex description
strict_lang_match boolean false can only be found by language matching users
same_gender boolean false can only be found by users with same gender
age_range list (int) [14, 90] can only be found by users within age range
hide_from_nearby boolean false don't expose to people nearby
hide_from_search boolean false can not be found by any search
hide_info_fields list (string) [] use a validation list to restrict hidable fields
partner_confirmation boolean true need confirmation to add

Learn Point

name type default max length min length required unique regex description
favorites int 0
pronunciations int 0
translations int 0
transliterations int 0
corrections int 0
transcriptions int 0

User Link

name type default max length min length required unique regex description
title string 50 true type of the user link
link string 255 true url to user's link
icon string 255 icon name
css_class string 50 icon css class name
order int 0

Language

name type default max length min length required unique regex description
name string 50 true true name of the language in latino
u_name string 100 native name of the language
abbrev string 10 true abbrev name for display(e.g. EN)

Chat

name type default max length min length required unique regex description
name string see description 50 true the name of chat will be ignored if it is a p2p chat and will be several users' username by default if it is a group chat
members list (objectId) [] list of members' ids
last_updated datetime now last time the chat updated (created or some members talked)

Message

name type default max length min length required unique regex description
from_id objectid true message sender id
to_chat objectid true chat id
type string text true choose between (text, voice, image)
voice_file_path string
text_content string
image_file_path string
undelivered list (objectid) list of objectid of all members in chat(to_chat) list of members in chat(to_chat) who have not received this message
timestamp datetime now

Partner Request

name type default max length min length required unique regex description
from_id objectid true
to_id objectid true
timestamp datetime now
status string pending choose between (pending, added, rejected, outdated)