{"id":2503,"date":"2017-01-20T07:21:51","date_gmt":"2017-01-20T07:21:50","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=2503"},"modified":"2025-06-13T20:40:58","modified_gmt":"2025-06-14T03:40:58","slug":"analyze-donald-trump-tweets-couchbase-n1ql","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/","title":{"rendered":"Analyze Donald Trump Tweets with Couchbase and N1QL"},"content":{"rendered":"<p><a href=\"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/\">AWS Serverless Lambda Scheduled Events to Store Tweets in Couchbase<\/a> explained how to store tweets\u00a0in Couchbase using AWS Serverless Lambda. Now, this Lambda Function has been running for a few days and has collected\u00a0269 tweets from <a href=\"https:\/\/twitter.com\/realDonaldTrump\">@realDonaldTrump<\/a>. This blog , inspired by <a href=\"https:\/\/dzone.com\/articles\/sql-on-twitter-twitter-analysis-made-easy\">SQL on Twitter: Analysis Made Easy Using N1QL<\/a>, will show how these tweets can be analyzed using\u00a0N1QL.<\/p>\n<p><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/getting-started\/first-n1ql-query.html\">N1QL<\/a> is a SQL-like\u00a0query language from <a href=\"https:\/\/developer.couchbase.com\/server\">Couchbase<\/a> that operates on JSON documents. <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/4.5\/n1ql\/n1ql-intro\/n1ql-sql-differences.html\">N1QL and SQL Differences<\/a>\u00a0provide differences between N1QL and SQL. Let&#8217;s use N1QL to\u00a0reveal some interesting information from <a href=\"https:\/\/twitter.com\/realDonaldTrump\">@realDonaldTrump<\/a>&#8216;s tweets. Many thanks to <a href=\"https:\/\/www.linkedin.com\/in\/sitaram-vemulapalli-2459503\">Sitaram from N1QL team<\/a> to help hack the queries.<\/p>\n<h2>How\u00a0Many Tweets<\/h2>\n<p>First query is to find out how many tweets are available in the database. The query is pretty simple: <strong>Query:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">SELECT COUNT(*) tweet_count \r\nFROM twitter;<\/pre>\n<p>As you notice, the syntax is very similar to SQL. <code><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/n1ql\/n1ql-language-reference\/selectintro.html\">SELECT<\/a><\/code>, <code>COUNT<\/code> and <code>FROM<\/code>\u00a0clauses are what you are already familiar with from SQL syntax.\u00a0<code>tweet_count<\/code> is an alias defined for the returned result. <code>twitter<\/code> is the bucket where all the JSON documents are stored. <strong>Results:<\/strong><\/p>\n<pre class=\"lang:js decode:true\">[\r\n  {\r\n    \"tweet_count\": 269\r\n  }\r\n]<\/pre>\n<p>The result is a JSON document as well.<\/p>\n<h2>Tweet Sample JSON Document<\/h2>\n<p>In order to write queries on a JSON document, you need to know the structure of the\u00a0document. The next query will give you that. <strong>Query:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">SELECT * \r\nFROM twitter \r\nLIMIT 1;<\/pre>\n<p>The new clause introduced here is <code><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/n1ql\/n1ql-language-reference\/limit.html\">LIMIT<\/a><\/code>. This allows to restrict the number of objects that are returned in a result set of <code>SELECT<\/code>. <strong>Results:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">[\r\n  {\r\n    \"twitter\": {\r\n      \"accessLevel\": \"0\",\r\n      \"contributors\": [],\r\n      \"createdAt\": \"1480828438000\",\r\n      \"currentUserRetweetId\": \"-1\",\r\n      \"displayTextRangeEnd\": \"-1\",\r\n      \"displayTextRangeStart\": \"-1\",\r\n      \"favoriteCount\": \"116356\",\r\n      \"favorited\": false,\r\n      \"geoLocation\": null,\r\n      \"hashtagEntities\": [],\r\n      \"id\": \"805278955150471168\",\r\n      \"inReplyToScreenName\": null,\r\n      \"inReplyToStatusId\": \"-1\",\r\n      \"inReplyToUserId\": \"-1\",\r\n      \"lang\": \"en\",\r\n      \"mediaEntities\": [],\r\n      \"place\": null,\r\n      \"possiblySensitive\": false,\r\n      \"quotedStatus\": null,\r\n      \"quotedStatusId\": \"-1\",\r\n      \"rateLimitStatus\": null,\r\n      \"retweet\": false,\r\n      \"retweetCount\": \"28330\",\r\n      \"retweeted\": false,\r\n      \"retweetedByMe\": false,\r\n      \"retweetedStatus\": null,\r\n      \"scopes\": null,\r\n      \"source\": \"<a href=\"https:\/\/twitter.com\/download\/android\" rel=\"nofollow\">Twitter for Android<\/a>\",\r\n      \"symbolEntities\": [],\r\n      \"text\": \"Just tried watching Saturday Night Live - unwatchable! Totally biased, not funny and the Baldwin impersonation just can't get any worse. Sad\",\r\n      \"truncated\": false,\r\n      \"urlentities\": [],\r\n      \"user\": {\r\n        \"accessLevel\": \"0\",\r\n        \"biggerProfileImageURL\": \"https:\/\/pbs.twimg.com\/profile_images\/1980294624\/DJT_Headshot_V2_bigger.jpg\",\r\n        \"biggerProfileImageURLHttps\": \"https:\/\/pbs.twimg.com\/profile_images\/1980294624\/DJT_Headshot_V2_bigger.jpg\",\r\n        \"contributorsEnabled\": false,\r\n        \"createdAt\": \"1237383998000\",\r\n        \"defaultProfile\": false,\r\n        \"defaultProfileImage\": false,\r\n        \"description\": \"President-elect of the United States\",\r\n        \"descriptionURLEntities\": [],\r\n        \"email\": null,\r\n        \"favouritesCount\": \"46\",\r\n        \"followRequestSent\": false,\r\n        \"followersCount\": \"19294404\",\r\n        \"friendsCount\": \"42\",\r\n        \"geoEnabled\": true,\r\n        \"id\": \"25073877\",\r\n        \"lang\": \"en\",\r\n        \"listedCount\": \"52499\",\r\n        \"location\": \"New York, NY\",\r\n        \"miniProfileImageURL\": \"https:\/\/pbs.twimg.com\/profile_images\/1980294624\/DJT_Headshot_V2_mini.jpg\",\r\n        \"miniProfileImageURLHttps\": \"https:\/\/pbs.twimg.com\/profile_images\/1980294624\/DJT_Headshot_V2_mini.jpg\",\r\n        \"name\": \"Donald J. Trump\",\r\n        \"originalProfileImageURL\": \"https:\/\/pbs.twimg.com\/profile_images\/1980294624\/DJT_Headshot_V2.jpg\",\r\n        \"originalProfileImageURLHttps\": \"https:\/\/pbs.twimg.com\/profile_images\/1980294624\/DJT_Headshot_V2.jpg\",\r\n        \"profileBackgroundColor\": \"6D5C18\",\r\n        \"profileBackgroundImageURL\": \"https:\/\/pbs.twimg.com\/profile_background_images\/530021613\/trump_scotland__43_of_70_cc.jpg\",\r\n        \"profileBackgroundImageUrlHttps\": \"https:\/\/pbs.twimg.com\/profile_background_images\/530021613\/trump_scotland__43_of_70_cc.jpg\",\r\n        \"profileBackgroundTiled\": true,\r\n        \"profileBannerIPadRetinaURL\": \"https:\/\/pbs.twimg.com\/profile_banners\/25073877\/1479776952\/ipad_retina\",\r\n        \"profileBannerIPadURL\": \"https:\/\/pbs.twimg.com\/profile_banners\/25073877\/1479776952\/ipad\",\r\n        \"profileBannerMobileRetinaURL\": \"https:\/\/pbs.twimg.com\/profile_banners\/25073877\/1479776952\/mobile_retina\",\r\n        \"profileBannerMobileURL\": \"https:\/\/pbs.twimg.com\/profile_banners\/25073877\/1479776952\/mobile\",\r\n        \"profileBannerRetinaURL\": \"https:\/\/pbs.twimg.com\/profile_banners\/25073877\/1479776952\/web_retina\",\r\n        \"profileBannerURL\": \"https:\/\/pbs.twimg.com\/profile_banners\/25073877\/1479776952\/web\",\r\n        \"profileImageURL\": \"https:\/\/pbs.twimg.com\/profile_images\/1980294624\/DJT_Headshot_V2_normal.jpg\",\r\n        \"profileImageURLHttps\": \"https:\/\/pbs.twimg.com\/profile_images\/1980294624\/DJT_Headshot_V2_normal.jpg\",\r\n        \"profileLinkColor\": \"0D5B73\",\r\n        \"profileSidebarBorderColor\": \"BDDCAD\",\r\n        \"profileSidebarFillColor\": \"C5CEC0\",\r\n        \"profileTextColor\": \"333333\",\r\n        \"profileUseBackgroundImage\": true,\r\n        \"protected\": false,\r\n        \"rateLimitStatus\": null,\r\n        \"screenName\": \"realDonaldTrump\",\r\n        \"showAllInlineMedia\": false,\r\n        \"status\": null,\r\n        \"statusesCount\": \"34269\",\r\n        \"timeZone\": \"Eastern Time (US &amp; Canada)\",\r\n        \"translator\": false,\r\n        \"url\": \"https:\/\/t.co\/mZB2hymxC9\",\r\n        \"urlentity\": {\r\n          \"displayURL\": \"https:\/\/t.co\/mZB2hymxC9\",\r\n          \"end\": \"23\",\r\n          \"expandedURL\": \"https:\/\/t.co\/mZB2hymxC9\",\r\n          \"start\": \"0\",\r\n          \"text\": \"https:\/\/t.co\/mZB2hymxC9\",\r\n          \"url\": \"https:\/\/t.co\/mZB2hymxC9\"\r\n        },\r\n        \"utcOffset\": \"-18000\",\r\n        \"verified\": true,\r\n        \"withheldInCountries\": null\r\n      },\r\n      \"userMentionEntities\": [],\r\n      \"withheldInCountries\": null\r\n    }\r\n  }\r\n]<\/pre>\n<h2>Top 5 Tweeting Days<\/h2>\n<p>After the basic queries are out of the way, let&#8217;s look at some interesting data now. What are the top 5 days\u00a0on which <a href=\"https:\/\/twitter.com\/realDonaldTrump\">@realDonaldTrump<\/a> tweeted and the tweet count? <strong>Query:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">SELECT SUBSTR(MILLIS_TO_STR(TO_NUM(createdAt)), 0, 10) tweet_date, \r\n       COUNT(1) tweet_count\r\nFROM   twitter \r\nGROUP  BY SUBSTR(MILLIS_TO_STR(TO_NUM(createdAt)), 0, 10) \r\nORDER  BY COUNT(1) DESC \r\nLIMIT  5;<\/pre>\n<p>Usual <code>GROUP BY<\/code> and <code>ORDER BY<\/code>\u00a0SQL clauses perform the same function. <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/n1ql\/n1ql-language-reference\/functions.html\">N1QL Functions<\/a>\u00a0apply a function to values. The <code>createdAt<\/code> field is returned a number as a\u00a0String. <code>TO_NUM<\/code> function converts the String to a number. <code><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/n1ql\/n1ql-language-reference\/datefun.html\">MILLIS_TO_STR<\/a><\/code> function converts the\u00a0String to a date. Finally, <code><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/n1ql\/n1ql-language-reference\/stringfun.html\">SUBSTR<\/a><\/code> function extracts the relevant part of the date. <strong>Results:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">[\r\n  {\r\n    \"tweet_count\": 13,\r\n    \"tweet_date\": \"2017-01-17\"\r\n  },\r\n  {\r\n    \"tweet_count\": 12,\r\n    \"tweet_date\": \"2017-01-06\"\r\n  },\r\n  {\r\n    \"tweet_count\": 11,\r\n    \"tweet_date\": \"2016-12-04\"\r\n  },\r\n  {\r\n    \"tweet_count\": 10,\r\n    \"tweet_date\": \"2017-01-03\"\r\n  },\r\n  {\r\n    \"tweet_count\": 10,\r\n    \"tweet_date\": \"2017-01-04\"\r\n  }\r\n]<\/pre>\n<p>Jan 17th, 2017 is the most tweeted day. Now, this result is of course restricted to the data from the\u00a0JSON documents stored in the database. Does\u00a0anybody have a more\u00a0comprehensive database of @realDonaldTrump\u00a0tweets?<\/p>\n<h2>Tweet Frequency<\/h2>\n<p>OK,\u00a0our database\u00a0shows that that maximum number of tweets in a day were 13. How do I find out how many days\u00a0@realDonaldTrump tweeted a certain number of times? <strong>Query:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">SELECT a.tweet_count, count(1) days FROM (\r\nSELECT SUBSTR(millis_to_str(to_num(createdAt)), 0, 10) tweet_date, \r\n       COUNT(1) tweet_count\r\nFROM   twitter \r\nGROUP  BY SUBSTR(millis_to_str(to_num(createdAt)), 0, 10)\r\n) a\r\nGROUP BY a.tweet_count\r\nORDER BY a.tweet_count DESC;<\/pre>\n<p>This is easily achieved using <a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/n1ql\/n1ql-language-reference\/subqueries.html\">N1QL nested queries<\/a>. <strong>Results:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">[\r\n  {\r\n    \"days\": 1,\r\n    \"tweet_count\": 13\r\n  },\r\n  {\r\n    \"days\": 1,\r\n    \"tweet_count\": 12\r\n  },\r\n  {\r\n    \"days\": 1,\r\n    \"tweet_count\": 11\r\n  },\r\n  {\r\n    \"days\": 2,\r\n    \"tweet_count\": 10\r\n  },\r\n  {\r\n    \"days\": 1,\r\n    \"tweet_count\": 9\r\n  },\r\n  {\r\n    \"days\": 7,\r\n    \"tweet_count\": 8\r\n  },\r\n  {\r\n    \"days\": 3,\r\n    \"tweet_count\": 7\r\n  },\r\n  {\r\n    \"days\": 7,\r\n    \"tweet_count\": 6\r\n  },\r\n  {\r\n    \"days\": 5,\r\n    \"tweet_count\": 5\r\n  },\r\n  {\r\n    \"days\": 5,\r\n    \"tweet_count\": 4\r\n  },\r\n  {\r\n    \"days\": 11,\r\n    \"tweet_count\": 3\r\n  },\r\n  {\r\n    \"days\": 3,\r\n    \"tweet_count\": 2\r\n  },\r\n  {\r\n    \"days\": 1,\r\n    \"tweet_count\": 1\r\n  }\r\n]<\/pre>\n<p>In 47 days, there is only one\u00a0day with a single tweet. A sum total of <code>tweet_count<\/code>\u00a0shows that there is no single\u00a0day without\u00a0a tweet :)<\/p>\n<h2>Most Common Hour In a Day To Tweet<\/h2>\n<p>@realDonaldTrump is known to <a href=\"https:\/\/www.politico.com\/story\/2016\/10\/trump-3-am-tweet-third-debate-230078\">tweet at 3am<\/a>. Let&#8217;s take a look what are the most common hours for him to tweet. <strong>Query:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">SELECT SUBSTR(MILLIS_TO_STR(TO_NUM(createdAt)), 11, 2) tweet_hour, \r\n       COUNT(1) tweet_count\r\nFROM   twitter \r\nGROUP  BY SUBSTR(MILLIS_TO_STR(TO_NUM(createdAt)), 11, 2) \r\nORDER  BY tweet_count DESC \r\nLIMIT  5;<\/pre>\n<p><strong>Results:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">[\r\n  {\r\n    \"tweet_count\": 39,\r\n    \"tweet_hour\": \"13\"\r\n  },\r\n  {\r\n    \"tweet_count\": 27,\r\n    \"tweet_hour\": \"12\"\r\n  },\r\n  {\r\n    \"tweet_count\": 26,\r\n    \"tweet_hour\": \"11\"\r\n  },\r\n  {\r\n    \"tweet_count\": 20,\r\n    \"tweet_hour\": \"14\"\r\n  },\r\n  {\r\n    \"tweet_count\": 15,\r\n    \"tweet_hour\": \"00\"\r\n  }\r\n]<\/pre>\n<p>Now seems like the controversial tweets come at 3am. But 39 tweets are coming at 1pm ET, likely right after lunch and while having a dessert ;)<\/p>\n<h2>Common Day of The Week to Tweet<\/h2>\n<p>Let&#8217;s find out what are the most common day of the week to tweet. <strong>Query:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">SELECT DATE_PART_STR(MILLIS_TO_STR(TO_NUM(createdAt)), \"day_of_week\") day_of_week, \r\n       COUNT(1) tweet_count\r\nFROM   twitter \r\nGROUP  BY DATE_PART_STR(MILLIS_TO_STR(TO_NUM(createdAt)), \"day_of_week\")\r\nORDER  BY tweet_count DESC;<\/pre>\n<p><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/n1ql\/n1ql-language-reference\/datefun.html\"><code>DATE_PART_STR<\/code><\/a> is a new function\u00a0returns date part of the date. Further <code>day_of_week<\/code>\u00a0attribute is used to get day of the week. <strong>Results:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">[\r\n  {\r\n    \"day_of_week\": 2,\r\n    \"tweet_count\": 49\r\n  },\r\n  {\r\n    \"day_of_week\": 3,\r\n    \"tweet_count\": 40\r\n  },\r\n  {\r\n    \"day_of_week\": 0,\r\n    \"tweet_count\": 40\r\n  },\r\n  {\r\n    \"day_of_week\": 5,\r\n    \"tweet_count\": 38\r\n  },\r\n  {\r\n    \"day_of_week\": 4,\r\n    \"tweet_count\": 36\r\n  },\r\n  {\r\n    \"day_of_week\": 6,\r\n    \"tweet_count\": 33\r\n  },\r\n  {\r\n    \"day_of_week\": 1,\r\n    \"tweet_count\": 33\r\n  }\r\n]<\/pre>\n<p>Seems like Tuesday is the most common day to tweet. Then comes Sunday and Wednesday at the same level. The performance tends to fizzle out closer to the weekend. <\/p>\n<p><a href=\"https:\/\/issues.couchbase.com\/browse\/MB-22417\">#22417<\/a>\u00a0should allow to report the\u00a0weekday part in English.<\/p>\n<h2>Top 5\u00a0Mentions in Tweets<\/h2>\n<p><strong>Query:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">SELECT COUNT(1) user_count, ue.screenName \r\n    FROM twitter \r\n    UNNEST userMentionEntities ue \r\n    GROUP by ue.screenName \r\n    ORDER by user_count DESC\r\n    LIMIT 5;<\/pre>\n<p><code>userMentionEntities<\/code> is a\u00a0nested array in the JSON document. <code><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/n1ql\/n1ql-language-reference\/from.html#concept_rnt_zfk_np__unnest\">UNNEST<\/a><\/code> conceptually performs a join of the nested array with its parent object. Each resulting joined object becomes an input to the query. <strong>Results:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">[\r\n  {\r\n    \"screenName\": \"realDonaldTrump\",\r\n    \"user_count\": 11\r\n  },\r\n  {\r\n    \"screenName\": \"FoxNews\",\r\n    \"user_count\": 7\r\n  },\r\n  {\r\n    \"screenName\": \"CNN\",\r\n    \"user_count\": 6\r\n  },\r\n  {\r\n    \"screenName\": \"NBCNews\",\r\n    \"user_count\": 5\r\n  },\r\n  {\r\n    \"screenName\": \"DanScavino\",\r\n    \"user_count\": 5\r\n  }\r\n]<\/pre>\n<p>Needless to say, he mentions his own\u00a0name the most in tweets! And his\u00a0two favorite TV stations <a href=\"https:\/\/twitter.com\/foxnews\">Fox News<\/a> and <a href=\"https:\/\/twitter.com\/cnn\">CNN<\/a>.<\/p>\n<h2>Top 5\u00a0Tweets with RTs<\/h2>\n<p>Lambda Function wakes up every 3 hours and fetches the latest tweets. So the database is a snapshot of tweets and associated information such as RTs and Favorites.\u00a0So\u00a0depending upon\u00a0when the tweet was archived, the RTs and Favorites may not be an accurate representation. But given this information, let&#8217;s take a look at the tweets with most RTs. <strong>Query:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">SELECT retweetCount, text\r\nFROM twitter\r\nORDER BY retweetCount\r\nLIMIT 5;<\/pre>\n<p>Pretty straight forward query. <strong>Results:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">[\r\n  {\r\n    \"retweetCount\": \"10110\",\r\n    \"text\": \"the American people. I have no doubt that we will, together, MAKE AMERICA GREAT AGAIN!\"\r\n  },\r\n  {\r\n    \"retweetCount\": \"10140\",\r\n    \"text\": \"Thank you to all of the men and women who protect &amp; serve our communities 24\/7\/365! n#LawEnforcementAppreciationDay\u2026 https:\/\/t.co\/aqUbDipSgv\"\r\n  },\r\n  {\r\n    \"retweetCount\": \"10370\",\r\n    \"text\": \"We had a great News Conference at Trump Tower today. A couple of FAKE NEWS organizations were there but the people truly get what's going on\"\r\n  },\r\n  {\r\n    \"retweetCount\": \"10414\",\r\n    \"text\": \"these companies are able to move between all 50 states, with no tax or tariff being charged. Please be forewarned prior to making a very ...\"\r\n  },\r\n  {\r\n    \"retweetCount\": \"10416\",\r\n    \"text\": \"Somebody hacked the DNC but why did they not have \"hacking defense\" like the RNC has and why have they not responded to the terrible......\"\r\n  }\r\n]<\/pre>\n<h2>Original vs RTs<\/h2>\n<p>How many of tweets were written vs retweeted? <strong>Query:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">SELECT retweet, count(1) count\r\nFROM twitter\r\nGROUP BY retweet;<\/pre>\n<p><strong>Results:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">[\r\n  {\r\n    \"count\": 253,\r\n    \"retweet\": false\r\n  },\r\n  {\r\n    \"count\": 15,\r\n    \"retweet\": true\r\n  }\r\n]<\/pre>\n<p>Most of the tweets are original with only a few RTs.<\/p>\n<h2>Most Common Words in Tweet<\/h2>\n<p><strong>Query:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">SELECT COUNT(1) count, word \r\nFROM twitter \r\nUNNEST SPLIT(text) word\r\nGROUP BY word\r\nORDER BY count DESC;<\/pre>\n<p>This query uses <code><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/n1ql\/n1ql-language-reference\/stringfun.html\">SPLIT<\/a><\/code> function that Results:<\/p>\n<pre class=\"lang:default decode:true\">[\r\n  {\r\n    \"count\": 189,\r\n    \"word\": \"the\"\r\n  },\r\n  {\r\n    \"count\": 151,\r\n    \"word\": \"to\"\r\n  },\r\n  {\r\n    \"count\": 115,\r\n    \"word\": \"and\"\r\n  },\r\n\r\n  . . .\r\n\r\n  {\r\n    \"count\": 1,\r\n    \"word\": \"presented...Trump's\"\r\n  },\r\n  {\r\n    \"count\": 1,\r\n    \"word\": \"jobs.\"\r\n  },\r\n  {\r\n    \"count\": 1,\r\n    \"word\": \"Doing\"\r\n  }\r\n]<\/pre>\n<h2>Frequency of words &#8220;media&#8221;, &#8220;fake&#8221; and &#8220;America&#8221; in tweets<\/h2>\n<p><strong>Query:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">SELECT COUNT(1) count, LOWER(w) word\r\nFROM twitter  \r\nUNNEST SPLIT(text) w  \r\nWHERE LOWER(w) IN [ \"media\", \"fake\", \"america\"] \r\nGROUP by LOWER(w) \r\nORDER BY count DESC;<\/pre>\n<p><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/n1ql\/n1ql-language-reference\/stringfun.html\"><code>LOWER<\/code><\/a> function is used to compare words independent of the case. <strong>Result:<\/strong><\/p>\n<pre class=\"lang:default decode:true\">[\r\n  {\r\n    \"count\": 12,\r\n    \"word\": \"media\"\r\n  },\r\n  {\r\n    \"count\": 9,\r\n    \"word\": \"fake\"\r\n  },\r\n  {\r\n    \"count\": 8,\r\n    \"word\": \"america\"\r\n  }\r\n]<\/pre>\n<p><a href=\"https:\/\/www.couchbase.com\/blog\/aws-serverless-lambda-scheduled-events-tweets-couchbase\/\">Lambda function<\/a>\u00a0will continue to\u00a0store tweets in the database.<\/p>\n<h2>Try these queries yourself?<\/h2>\n<ul>\n<li>Start a Couchbase Server<\/li>\n<li>Use the archive\u00a0<a href=\"https:\/\/blog.arungupta.me\/wp-content\/uploads\/2017\/01\/twitter-backups-2017-01-20-06-07-49.tar.gz\">twitter-backups-2017-01-20-06-07-49.tar<\/a>\u00a0as explained at <a href=\"https:\/\/github.com\/couchbase-guides\/couchbase-backup-restore#restore-data-to-couchbase-server\">Restore Data To\u00a0Couchbase<\/a><\/li>\n<li>Use <a href=\"https:\/\/www.youtube.com\/embed\/bJUl-brAqvk\">Query Workbench<\/a> to fire the queries<\/li>\n<\/ul>\n<h2>N1QL References<\/h2>\n<ul>\n<li><a href=\"https:\/\/query.pub.couchbase.com\/tutorial\/#1\">N1QL Interactive Tutorial<\/a><\/li>\n<li><a href=\"https:\/\/docs.couchbase.com\/files\/Couchbase-N1QL-CheatSheet.pdf\">N1QL Cheatsheet<\/a><\/li>\n<li><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/n1ql\/n1ql-language-reference\/index.html\">N1QL Language Reference<\/a><\/li>\n<li><a href=\"https:\/\/developer.couchbase.com\/documentation\/server\/current\/getting-started\/first-n1ql-query.html\">Run Your First\u00a0N1QL Query<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>AWS Serverless Lambda Scheduled Events to Store Tweets in Couchbase explained how to store tweets\u00a0in Couchbase using AWS Serverless Lambda. Now, this Lambda Function has been running for a few days and has collected\u00a0269 tweets from @realDonaldTrump. This blog , [&hellip;]<\/p>\n","protected":false},"author":58,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1816,1812],"tags":[10124,1261],"ppma_author":[8933],"class_list":["post-2503","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-couchbase-server","category-n1ql-query","tag-amazon-web-services-aws","tag-json"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.2 (Yoast SEO v26.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Analyze Donald Trump Tweets with Couchbase and N1QL<\/title>\n<meta name=\"description\" content=\"This blog is inspired by SQL on Twitter: Analysis Made Easy Using N1QL blog by Donald Trump, will show how these tweets can be analyzed using N1QL.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Analyze Donald Trump Tweets with Couchbase and N1QL\" \/>\n<meta property=\"og:description\" content=\"This blog is inspired by SQL on Twitter: Analysis Made Easy Using N1QL blog by Donald Trump, will show how these tweets can be analyzed using N1QL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-20T07:21:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T03:40:58+00:00\" \/>\n<meta name=\"author\" content=\"Arun Gupta, VP, Developer Advocacy, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@arungupta\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Arun Gupta, VP, Developer Advocacy, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/\"},\"author\":{\"name\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f\"},\"headline\":\"Analyze Donald Trump Tweets with Couchbase and N1QL\",\"datePublished\":\"2017-01-20T07:21:50+00:00\",\"dateModified\":\"2025-06-14T03:40:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/\"},\"wordCount\":820,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"Amazon Web Services (AWS)\",\"JSON\"],\"articleSection\":[\"Couchbase Server\",\"SQL++ \/ N1QL Query\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/\",\"name\":\"Analyze Donald Trump Tweets with Couchbase and N1QL\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2017-01-20T07:21:50+00:00\",\"dateModified\":\"2025-06-14T03:40:58+00:00\",\"description\":\"This blog is inspired by SQL on Twitter: Analysis Made Easy Using N1QL blog by Donald Trump, will show how these tweets can be analyzed using N1QL.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Analyze Donald Trump Tweets with Couchbase and N1QL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f\",\"name\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8900a75409c646948fe0bd80f6240337\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g\",\"caption\":\"Arun Gupta, VP, Developer Advocacy, Couchbase\"},\"description\":\"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team. Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta.\",\"sameAs\":[\"https:\/\/x.com\/arungupta\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/author\/arun-gupta\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Analyze Donald Trump Tweets with Couchbase and N1QL","description":"This blog is inspired by SQL on Twitter: Analysis Made Easy Using N1QL blog by Donald Trump, will show how these tweets can be analyzed using N1QL.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/","og_locale":"en_US","og_type":"article","og_title":"Analyze Donald Trump Tweets with Couchbase and N1QL","og_description":"This blog is inspired by SQL on Twitter: Analysis Made Easy Using N1QL blog by Donald Trump, will show how these tweets can be analyzed using N1QL.","og_url":"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/","og_site_name":"The Couchbase Blog","article_published_time":"2017-01-20T07:21:50+00:00","article_modified_time":"2025-06-14T03:40:58+00:00","author":"Arun Gupta, VP, Developer Advocacy, Couchbase","twitter_card":"summary_large_image","twitter_creator":"@arungupta","twitter_misc":{"Written by":"Arun Gupta, VP, Developer Advocacy, Couchbase","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/"},"author":{"name":"Arun Gupta, VP, Developer Advocacy, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f"},"headline":"Analyze Donald Trump Tweets with Couchbase and N1QL","datePublished":"2017-01-20T07:21:50+00:00","dateModified":"2025-06-14T03:40:58+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/"},"wordCount":820,"commentCount":0,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["Amazon Web Services (AWS)","JSON"],"articleSection":["Couchbase Server","SQL++ \/ N1QL Query"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/","url":"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/","name":"Analyze Donald Trump Tweets with Couchbase and N1QL","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2017-01-20T07:21:50+00:00","dateModified":"2025-06-14T03:40:58+00:00","description":"This blog is inspired by SQL on Twitter: Analysis Made Easy Using N1QL blog by Donald Trump, will show how these tweets can be analyzed using N1QL.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/analyze-donald-trump-tweets-couchbase-n1ql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Analyze Donald Trump Tweets with Couchbase and N1QL"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"The Couchbase Blog","description":"Couchbase, the NoSQL Database","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"The Couchbase Blog","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/39d8caed0f536489b6aa6e8d31ee631f","name":"Arun Gupta, VP, Developer Advocacy, Couchbase","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8900a75409c646948fe0bd80f6240337","url":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","caption":"Arun Gupta, VP, Developer Advocacy, Couchbase"},"description":"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team. Gupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta.","sameAs":["https:\/\/x.com\/arungupta"],"url":"https:\/\/www.couchbase.com\/blog\/author\/arun-gupta\/"}]}},"authors":[{"term_id":8933,"user_id":58,"is_guest":0,"slug":"arun-gupta","display_name":"Arun Gupta, VP, Developer Advocacy, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/f912e10b5f39748ee4f1a0b0da6f42747f0b3a94fe7acb511791468656f5e726?s=96&d=mm&r=g","author_category":"","last_name":"Gupta","first_name":"Arun","job_title":"","user_url":"","description":"Arun Gupta is the vice president of developer advocacy at Couchbase. He has built and led developer communities for 10+ years at Sun, Oracle, and Red Hat. He has deep expertise in leading cross-functional teams to develop and execute strategy, planning and execution of content, marketing campaigns, and programs. Prior to that he led engineering teams at Sun and is a founding member of the Java EE team.\r\n\r\nGupta has authored more than 2,000 blog posts on technology. He has extensive speaking experience in more than 40 countries on myriad topics and is a JavaOne Rock Star for three years in a row. Gupta also founded the Devoxx4Kids chapter in the US and continues to promote technology education among children. An author of several books on technology, an avid runner, a globe trotter, a Java Champion, a JUG leader, NetBeans Dream Team member, and a Docker Captain, he is easily accessible at @arungupta."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2503","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/users\/58"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/comments?post=2503"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/posts\/2503\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/media?parent=2503"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/categories?post=2503"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/tags?post=2503"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=2503"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}