Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

What is data modeling in MongoDB

- Data modeling is the process of defining how data is stored and what relationships exist between different entities in our data.
- Data modeling aims to visually represent the relationship between different entities in data. It also seeks to represent the data’s organization and grouping.

Type of modeling :

1. Embedded Documents:-
{
  _id: <ObjectId123>,
  title: "Data Modelling in MongoDB",
  body: "some long text...",
  comments: [
    { 
      _id: <ObjectId111>,
      comment: "some text...",
      author: "mike@email.com"     
    },
    { 
      _id: <ObjectId222>,
      comment: "some text...",
      author: "jake@email.com"    
    }
  ]
}

---------------------------------------------------------------
2. References:-
// blog post
{
  _id: <ObjectId123>,
  title: "Data Modelling in MongoDB",
  body: "some long text..."
}

// comments
{ 
  _id: <ObjectId111>,
  comment: "some text...",
  author: "mike@email.com",
  postId: <ObjectId123>. // reference to the blog post
},
{ 
  _id: <ObjectId222>,
  comment: "some text...",
  author: "jake@email.com",
  postId: <ObjectId123>    // reference to the blog post 
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to check all elements in array includes in another array javascript 
Javascript :: function palindrome javascript 
Javascript :: redirect if not logged in next js 
Javascript :: angular js parse json 
Javascript :: jqueryreplace content of div 
Javascript :: consoleLine 
Javascript :: how to reset input field in javascript 
Javascript :: dangerouslySetInnerHTML 
Javascript :: parent of heap node 
Javascript :: nextjs check production or development environment 
Javascript :: upload file in react 
Javascript :: javascript set query parameter 
Javascript :: insert new object values 
Javascript :: react js image path src from local folder 
Javascript :: error: node_modules/react-native-reanimated/src/index.ts: 
Javascript :: unix timestamp to date javascript yyyy-mm-dd 
Javascript :: react native get timezone 
Javascript :: how to get key from a button in react 
Javascript :: javascript stop the form from reloading 
Javascript :: .split is not a function 
Javascript :: javascript input prompt example 
Javascript :: js number format 
Javascript :: how to make pages from list in nodejs 
Javascript :: how to hide a input and label jquery 
Javascript :: js call function by string name 
Javascript :: npm react dom routing 
Javascript :: union of two arrays javascript 
Javascript :: ion input ios keyboard over 
Javascript :: use eslint in vscode 
Javascript :: find largest number from an array in JavaScript 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =