Wednesday, February 20, 2019

Basic MongoDB(NoSQL) Part 03: Data modeling and Schema

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
      }
   ]
}



You may leave comment to improve it.
Thank you from THAILAND.

No comments:

Android OS: Fundamental Awareness

Thai government single policy     *** IMPORTANT *** Please carefully take a look this post https://chattrawits-security.blogspo...