Skip to main content

Posts

Showing posts with the label Data

Data Association Study Notes: Six Steps to Embedded Data

What is Association? Association will allow us to have multiple pieces of data collections in our database that are related to one another. Just like a Facebook user can have multiple posts or images in his account. Three Types of Association One to One:   One of entity that's related to one another entity. For example, one student has one unique student ID. One to Many:  One entity that's related to many of other entity. For example, one student has multiple social media accounts. And those social media accounts only belong to this student. Many to Many:  Many entity related to both ways. For example, one student can take many course, and one course has many students. Embedded Data In this example, we will do the "One to Many" type. We have user and post. We want one user to have multiple posts. Step One: Set up and define schema Firstly, we need to create a new file "embed,js", and npm install mongoose. Then, we require the mong...

Study Note For API's: These Two Main Data Formats You Should Know

What is API's? API's stands for application programming interface. They are interfaces for code or computers to talk to one another. For example, we can use a Facebook account to login to Instagram. When we connect these two apps, Instagrams will link to and access your Facebook data. When you upload photos on Instagram, it will be automatically uploaded on Facebook, too. We also use a lot of Web API's every day. Web API's generally to communicate via HTTP. For example, we may ask Yelp API's to recommend 10 nearby Sushi restaurants in a certain zip code. Data Formats There are two main formats that web API is responded with: XML and JSON . When we use the internet, we make an HTTP request and get HTML back. API's don't respond with HTML because HTML contains information about the structure of a page. API's respond with data, not structure. XML XML stands for Extended Markup Language. It is syntactically similar to HTML, but it...