{
_id:string //doubles for user's name
password: {
hash:string
salt:string
}
website:string
bio:string
following:array of {
username:string
articles:boolean
comments:boolean
}
}
Articles
{
_id:ObjectID //auto id
title:string
contents:string
owner:string //references Users
tags:array of strings //no reference, tags are either unfiltered or selected from a global tag list.
}
Comments
{
_id:ObjectID //auto id
contents:string
owner:string //references Users
root:ObjectID //references Articles instead of Comments
parents:array of ObjectIDs //using materialized path for threading of comments
}
Config
{
_id:string
value:? //untyped can store anything in json format
}
Note: The references are defined entirely in software, the database is not aware of them.
Comments
Here's an example schema.
Users
Articles Comments Config Note: The references are defined entirely in software, the database is not aware of them.