MongoDB Part 03: Data modeling and Schema
>>> Data modeling <<<
> Document Schema <
For example, it is a webpage layout or Mock-up like this |
A collection(a webpage) may have many documents(sets of comment). Therefore, document and its schema may be like these:
This is a document and its schema below |
{
_id: POST_ID
title: TITLE_OF_POST,
description: POST_DESCRIPTION,
by: POST_BY,
url: URL_OF_POST,
likes: TOTAL_LIKES,
comments: [
{
user:'COMMENT_BY',
message: TEXT,
dateCreated: DATE_TIME,
like: LIKES
},
{
user:'COMMENT_BY',
message: TEXT,
dateCreated: DATE_TIME,
like: LIKES
}
]
}
Reference
https://www.tutorialspoint.com/mongodb/mongodb_create_database.htm
https://s-media-cache-ak0.pinimg.com/originals/5f/72/97/5f72974fa68a0c5083ef3482f90be78e.jpg
http://www.theunrealtimes.com/wp-content/uploads/2011/04/snapshot-1.gif
https://www.tutorialspoint.com/mongodb/mongodb_create_database.htm
https://s-media-cache-ak0.pinimg.com/originals/5f/72/97/5f72974fa68a0c5083ef3482f90be78e.jpg
http://www.theunrealtimes.com/wp-content/uploads/2011/04/snapshot-1.gif
You may leave comment to improve it.
Thank you from THAILAND.
No comments:
Post a Comment