Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

type of data model 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 :: check if element is visible or hidden in dom 
Javascript :: javascript last character 
Javascript :: javascript credit card validation 
Javascript :: select by style in jquery 
Javascript :: how to add toaster in angular 9 
Javascript :: javascript get array min and max 
Javascript :: serving html file using node.js 
Javascript :: vue cli - Uncaught SyntaxError: Unexpected token < 
Javascript :: javascript early break reduce() method 
Javascript :: is node js faster than python 
Javascript :: ternary operator in angular 
Javascript :: console.log clear screen 
Javascript :: code challenges javascript 
Javascript :: js window location relative path 
Javascript :: js set css variable 
Javascript :: jquery make new variable with dynamic name 
Javascript :: javascript array to string 
Javascript :: javascript disable form 
Javascript :: multiple click events in react 
Javascript :: rm -rf node_modules 
Javascript :: jqiery check if scroll to end 
Javascript :: What is the Difference between Undefined, undeclared, Null 
Javascript :: axios network error react native 
Javascript :: javascript list include 
Javascript :: jquery table each rows with class 
Javascript :: install react router dom with npm 
Javascript :: .includes( string 
Javascript :: vuex add multiple payload to mutation 
Javascript :: converting a string into a number in javascript 
Javascript :: how to find largest number in array in javascript 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =