【发布时间】:2013-06-25 05:38:13
【问题描述】:
我正在 Node.js + MongoDB 数据库中创建一个博客应用程序。我以前使用过像 MySQL 这样的关系数据库,但这是我第一次使用 NoSQL 数据库。所以我想在我进一步行动之前符合我的 MongoDB 数据模型。
我已经决定我的 blogDB 有 3 个集合
- post_collection - 存储有关该文章的信息
- comment_collection - 在文章中存储有关 cmets 的信息
- user_info_collection - 包含用户信息
后数据库
{
_"id" : ObjectID(...),
"author": "author_name",
"Date": new Date(....),
"tag" : ["politics" , "war"],
"post_title": "My first Article",
"post_content": "Big big article"
"likes": 23
"access": "public"
}
评论数据库
{
"_id" : Objectid(...),
"POST": "My First Article",
"comment_by": "User_name",
"comment": "MY comments"
}
用户信息数据库
{
"_id": ObjectID(...),
"user": "User_name",
"password": "My_password"
}
我会很感激你的 cmets。
【问题讨论】:
-
SO 可能不适合没有具体答案的问题。如果您有具体问题,请询问,并查看tinyurl.com/cjk2hnx
-
或者,这可能是“代码审查”或“数据库管理员”类型的问题。
标签: node.js mongodb database nosql