2. Documents and Data Types
Activity 2.01: Modeling a Tweet into a JSON Document
Solution:
Perform the following steps to complete the activity:
- Identify and list the following fields from the tweet that can be included in the JSON document:
creation date and time user id user name user profile pic user verification status hash tags mentions tweet text likes comments retweets
- Group the related fields such that they can be placed as embedded objects or arrays. Since a tweet can have multiple hashtags and mentions, it can be represented as an array. The modified list appears as follows:
creation date and time user id name profile pic verification status hash tags [tags] mentions [mentions] tweet text likes comments retweets
- Prepare the user object and add the values from the tweet:
{ "id": "Lord_Of_Winterfell", "name": "Office of Ned...