Database Structure - DanielvandeVelde/Matcher GitHub Wiki
Database Structure
I'm using MongoDB for my database.
I require different values that sometimes have their own extra server-side validation.
For this I will point you to my Mongoose model/User schema.
Example document
| Field | Type | Description |
|---|---|---|
| _id | String | automatic MongoDB unique identifier |
| username | String | User entered username |
| String | User entered e-mail | |
| name | String | User entered name |
| gender | String | User selected value (Man, Woman) |
| age | Number | User entered age, value (18-100) |
| looking | String | User selected value (Man, Woman, No preference) |
| loc | Object | Holds geoData (type & coordinates) |
| type | String | Has value "Point" part of loc-object |
| coordinates | Array | Holds two user-selected Numbers* part of loc-object |
| date | String | Date and time of creation |
| likes | Array | Holds Strings of usernames |
| salt | String | A bunch of gibberish 🤠 |
| hash | String | Password encrypted with the salt |
* First number is the longitude and has a value between -180 and 180.
Second number is the latitude and has a value between -90 and 90.