Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bancos de Dados não Relacionais - MongoDB

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

Bancos de Dados não Relacionais - MongoDB

More Decks by Code4Pol - Reprogramando a Política

Other Decks in Programming

Transcript

  1. { matricula: 1, nome: ‘Alexandre', telefone: ‘81338383’}, { matricula: 2,

    nome: ‘Zeca', telefone: ‘9123745’}, { matricula: 3, nome: ‘Paulinho', telefone: ‘99736544’}
  2. { matricula: 1, nome: ‘Alexandre', telefone: ‘81338383’}, { matricula: 2,

    nome: ‘Zeca', telefone: ‘9123745’}, { matricula: 3, nome: ‘Paulinho', telefone: ‘99736544’}
  3. { matricula: 1, nome: ‘Alexandre', telefone: ‘81338383’}, { matricula: 2,

    nome: ‘Zeca', telefone: ‘9123745’}, { matricula: 3, nome: ‘Paulinho', telefone: ‘99736544’}
  4. { matricula: 1, nome: ‘Alexandre', telefone: ‘81338383’}, { matricula: 2,

    nome: ‘Zeca', telefone: ‘9123745’}, { matricula: 3, nome: ‘Paulinho', telefone: ‘99736544’}
  5. { matricula: 1, nome: ‘Alexandre', telefone: ‘81338383’}, { matricula: 2,

    nome: ‘Zeca', telefone: ‘9123745’}, { matricula: 3, nome: ‘Paulinho', telefone: ‘99736544’} matricula nome telefone 000001 Alexandre 81333388 000002 Zeca 9123745 000003 Paulinho 99736544
  6. { nome : Alexandre, sobrenome : Gomes, telefone : 6181333333

    }, { nome : Marisa, sobrenome : Bulow, telefone : 6198765432 }, { nome : Teo, sobrenome : Moura, telefone : 6171635489 } nome sobrenome telefone Alexandre Gomes 6181333333 Marisa Bulow 6198765432 Teo Moura 6171635489
  7. { nome : Alexandre, sobrenome : Gomes, telefone : {

    ddd: 61, op : Vivo, num : 81333333 } { nome : Marisa, sobrenome : Bulow, telefone : { ddd: 61, op : Claro, num : 98765432 } } nome sobre nome tel_ddd tel_op tel_num Alexandre Gomes 61 Vivo 81333333 Marisa Bulow 61 Claro 98765432 Teo Moura 61 TIM 71635489
  8. { nome : Alexandre, sobrenome : Gomes, telefone : {

    ddd: 61, op : Vivo, num : 81333333 } { nome : Marisa, sobrenome : Bulow, telefone : { ddd: 61, op : Claro, num : 98765432 } } nome sobre nome tel Alexandre Gomes 1 Marisa Bulow 2 Teo Moura 3 id ddd op num 1 61 Vivo 81333333 2 61 Claro 98765432 3 61 TIM 71635489
  9. {"created_at":"Tue Dec 15 02:59:44 +0000 2015","id":676597482013487104,"id_str":"676597482013487104","text":"RT @BetinhoJose_Rec: Parab\u00e9ns presidenta @dilmabr!

    #FicaDilma mais seja firme com a for\u00e7a da mulher guerreira que a senhora \u00e9! https:\/\/t.c\u2026","source":"\u003ca href=\"http:\/\/twitter.com\/download\/ android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a \u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_na me":null,"user":{"id": 861617935,"id_str":"861617935","name":"Dursilvanribeiro","screen_name":"Dudurrauer","location":null,"url":null,"description":null,"protected":false,"verified":false,"fo llowers_count":367,"friends_count":709,"listed_count":0,"favourites_count":6,"statuses_count":708,"created_at":"Thu Oct 04 15:53:21 +0000 2012","utc_offset":null,"time_zone":null,"geo_enabled":false,"lang":"pt","contributors_enabled":false,"is_translator":false,"profile_background_color":"C0DEED","profile _background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/ bg.png","profile_background_tile":false,"profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color" :"333333","profile_use_background_image":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/2681381838\/ 37fcfa873468f095360694222e3df899_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/2681381838\/ 37fcfa873468f095360694222e3df899_normal.jpeg","default_profile":true,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"ge o":null,"coordinates":null,"place":null,"contributors":null,"retweeted_status":{"created_at":"Mon Dec 14 16:37:27 +0000 2015","id": 676440878446153728,"id_str":"676440878446153728","text":"Parab\u00e9ns presidenta @dilmabr! #FicaDilma mais seja firme com a for\u00e7a da mulher guerreira que a senhora \u00e9! https:\/\/t.co\/nTdIgJMCqT","source":"\u003ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a \u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_na me":null,"user":{"id":1467660972,"id_str":"1467660972","name":"BETINHO JOS\u00c9","screen_name":"BetinhoJose_Rec","location":"Recife - Pernambuco","url":"https:\/\/ www.facebook.com\/pages\/Betinho-Jos%C3%A9\/552364058251241?fref=ts#","description":"Sou educador social, blogueiro, radialista, profissional de r\u00e1dio e TV","protected":false,"verified":false,"followers_count":447,"friends_count":1973,"listed_count":3,"favourites_count":450,"statuses_count":5496,"created_at":"Wed May 29 16:27:56 +0000 2013","utc_offset":-7200,"time_zone":"Brasilia","geo_enabled":true,"lang":"pt","contributors_enabled":false,"is_translator":false,"profile_background_color":"000000","p rofile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme19\/bg.gif","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/ theme19\/ bg.gif","profile_background_tile":false,"profile_link_color":"3B94D9","profile_sidebar_border_color":"000000","profile_sidebar_fill_color":"000000","profile_text_color" :"000000","profile_use_background_image":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/676458441288871937\/ HsPqvwr3_normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/676458441288871937\/HsPqvwr3_normal.jpg","profile_banner_url":"https:\/\/ pbs.twimg.com\/profile_banners\/1467660972\/ 1446509862","default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place ":null,"contributors":null,"quoted_status_id":676403905891344385,"quoted_status_id_str":"676403905891344385","quoted_status":{"created_at":"Mon Dec 14 14:10:32 +0000 2015","id":676403905891344385,"id_str":"676403905891344385","text":"(A) Feliz anivers\u00e1rio, presidenta! Que este cora\u00e7\u00e3o valente continue lutando pela democracia e pelo Brasil. Q honra! https:\/\/t.co\/wx659Rc0po","source":"\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a \u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_na me":null,"user":{"id":51064768,"id_str":"51064768","name":"F\u00e1tima Bezerra","screen_name":"Fatima_Bezerra","location":"Rio Grande do Norte","url":"http:\/\/ www.fatimabezerra.com.br","description":"F\u00e1tima \u00e9 professora e senadora eleita em 2014 com 808.055 votos no RN.","protected":false,"verified":false,"followers_count":49982,"friends_count":1047,"listed_count":385,"favourites_count":698,"statuses_count":40217,"created_at":"Fri Jun 26 13:51:32 +0000 2009","utc_offset":-7200,"time_zone":"Brasilia","geo_enabled":true,"lang":"pt","contributors_enabled":false,"is_translator":false,"profile_background_color":"FCFFFF","p rofile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/489137936269447168\/wrgvbWBc.png","profile_background_image_url_https":"https:\/\/ pbs.twimg.com\/profile_background_images\/489137936269447168\/ wrgvbWBc.png","profile_background_tile":true,"profile_link_color":"B3002D","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"FFCCDF","profile_text_c olor":"333333","profile_use_background_image":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/520948025435230209\/ Hi20Any4_normal.png","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/520948025435230209\/Hi20Any4_normal.png","profile_banner_url":"https:\/\/ pbs.twimg.com\/profile_banners\/51064768\/ 1450108382","default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place ":null,"contributors":null,"is_quote_status":false,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"urls":[],"user_mentions":[],"symbols":[],"media": [{"id":676403904230375425,"id_str":"676403904230375425","indices":[117,140],"media_url":"http:\/\/pbs.twimg.com\/media\/CWMRxGRWwAEBicv.png","media_url_https":"https:\/ \/pbs.twimg.com\/media\/CWMRxGRWwAEBicv.png","url":"https:\/\/t.co\/wx659Rc0po","display_url":"pic.twitter.com\/wx659Rc0po","expanded_url":"http:\/\/twitter.com\/ Fatima_Bezerra\/status\/676403905891344385\/photo\/1","type":"photo","sizes":{"small":{"w":340,"h":340,"resize":"fit"},"thumb":{"w":150,"h": 150,"resize":"crop"},"medium":{"w":600,"h":600,"resize":"fit"},"large":{"w":600,"h":600,"resize":"fit"}}}]},"extended_entities":{"media":[{"id": 676403904230375425,"id_str":"676403904230375425","indices":[117,140],"media_url":"http:\/\/pbs.twimg.com\/media\/CWMRxGRWwAEBicv.png","media_url_https":"https:\/\/ pbs.twimg.com\/media\/CWMRxGRWwAEBicv.png","url":"https:\/\/t.co\/wx659Rc0po","display_url":"pic.twitter.com\/wx659Rc0po","expanded_url":"http:\/\/twitter.com\/ Fatima_Bezerra\/status\/676403905891344385\/photo\/1","type":"photo","sizes":{"small":{"w":340,"h":340,"resize":"fit"},"thumb":{"w":150,"h": 150,"resize":"crop"},"medium":{"w":600,"h":600,"resize":"fit"},"large":{"w":600,"h": 600,"resize":"fit"}}}]},"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"pt"},"is_quote_status":true,"retweet_count": 2,"favorite_count":0,"entities":{"hashtags":[{"text":"FicaDilma","indices":[30,40]}],"urls":[{"url":"https:\/\/t.co\/nTdIgJMCqT","expanded_url":"https:\/\/twitter.com\/ Fatima_Bezerra\/status\/676403905891344385","display_url":"twitter.com\/Fatima_Bezerra\u2026","indices":[107,130]}],"user_mentions": [{"screen_name":"dilmabr","name":"Dilma Rousseff","id":131574396,"id_str":"131574396","indices":[20,28]}],"symbols": []},"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"pt"},"is_quote_status":true,"retweet_count":0,"favorite_count": 0,"entities":{"hashtags":[{"text":"FicaDilma","indices":[51,61]}],"urls":[{"url":"https:\/\/t.co\/nTdIgJMCqT","expanded_url":"https:\/\/twitter.com\/Fatima_Bezerra\/ status\/676403905891344385","display_url":"twitter.com\/Fatima_Bezerra\u2026","indices":[139,140]}],"user_mentions":[{"screen_name":"BetinhoJose_Rec","name":"BETINHO JOS\u00c9","id":1467660972,"id_str":"1467660972","indices":[3,19]},{"screen_name":"dilmabr","name":"Dilma Rousseff","id":131574396,"id_str":"131574396","indices": [41,49]}],"symbols":[]},"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"pt","timestamp_ms":"1450148384942"}
  10. {"created_at":"Tue Dec 15 02:59:44 +0000 2015","id":676597482013487104,"id_str":"676597482013487104","text":"RT @BetinhoJose_Rec: Parab\u00e9ns presidenta @dilmabr!

    #FicaDilma mais seja firme com a for\u00e7a da mulher guerreira que a senhora \u00e9! https:\/\/t.c\u2026","source":"\u003ca href=\"http:\/\/twitter.com\/download\/ android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a \u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_na me":null,"user":{"id": 861617935,"id_str":"861617935","name":"Dursilvanribeiro","screen_name":"Dudurrauer","location":null,"url":null,"description":null,"protected":false,"verified":false,"fo llowers_count":367,"friends_count":709,"listed_count":0,"favourites_count":6,"statuses_count":708,"created_at":"Thu Oct 04 15:53:21 +0000 2012","utc_offset":null,"time_zone":null,"geo_enabled":false,"lang":"pt","contributors_enabled":false,"is_translator":false,"profile_background_color":"C0DEED","profile _background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/ bg.png","profile_background_tile":false,"profile_link_color":"0084B4","profile_sidebar_border_color":"C0DEED","profile_sidebar_fill_color":"DDEEF6","profile_text_color" :"333333","profile_use_background_image":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/2681381838\/ 37fcfa873468f095360694222e3df899_normal.jpeg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/2681381838\/ 37fcfa873468f095360694222e3df899_normal.jpeg","default_profile":true,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"ge o":null,"coordinates":null,"place":null,"contributors":null,"retweeted_status":{"created_at":"Mon Dec 14 16:37:27 +0000 2015","id": 676440878446153728,"id_str":"676440878446153728","text":"Parab\u00e9ns presidenta @dilmabr! #FicaDilma mais seja firme com a for\u00e7a da mulher guerreira que a senhora \u00e9! https:\/\/t.co\/nTdIgJMCqT","source":"\u003ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a \u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_na me":null,"user":{"id":1467660972,"id_str":"1467660972","name":"BETINHO JOS\u00c9","screen_name":"BetinhoJose_Rec","location":"Recife - Pernambuco","url":"https:\/\/ www.facebook.com\/pages\/Betinho-Jos%C3%A9\/552364058251241?fref=ts#","description":"Sou educador social, blogueiro, radialista, profissional de r\u00e1dio e TV","protected":false,"verified":false,"followers_count":447,"friends_count":1973,"listed_count":3,"favourites_count":450,"statuses_count":5496,"created_at":"Wed May 29 16:27:56 +0000 2013","utc_offset":-7200,"time_zone":"Brasilia","geo_enabled":true,"lang":"pt","contributors_enabled":false,"is_translator":false,"profile_background_color":"000000","p rofile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme19\/bg.gif","profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/ theme19\/ bg.gif","profile_background_tile":false,"profile_link_color":"3B94D9","profile_sidebar_border_color":"000000","profile_sidebar_fill_color":"000000","profile_text_color" :"000000","profile_use_background_image":false,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/676458441288871937\/ HsPqvwr3_normal.jpg","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/676458441288871937\/HsPqvwr3_normal.jpg","profile_banner_url":"https:\/\/ pbs.twimg.com\/profile_banners\/1467660972\/ 1446509862","default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place ":null,"contributors":null,"quoted_status_id":676403905891344385,"quoted_status_id_str":"676403905891344385","quoted_status":{"created_at":"Mon Dec 14 14:10:32 +0000 2015","id":676403905891344385,"id_str":"676403905891344385","text":"(A) Feliz anivers\u00e1rio, presidenta! Que este cora\u00e7\u00e3o valente continue lutando pela democracia e pelo Brasil. Q honra! https:\/\/t.co\/wx659Rc0po","source":"\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a \u003e","truncated":false,"in_reply_to_status_id":null,"in_reply_to_status_id_str":null,"in_reply_to_user_id":null,"in_reply_to_user_id_str":null,"in_reply_to_screen_na me":null,"user":{"id":51064768,"id_str":"51064768","name":"F\u00e1tima Bezerra","screen_name":"Fatima_Bezerra","location":"Rio Grande do Norte","url":"http:\/\/ www.fatimabezerra.com.br","description":"F\u00e1tima \u00e9 professora e senadora eleita em 2014 com 808.055 votos no RN.","protected":false,"verified":false,"followers_count":49982,"friends_count":1047,"listed_count":385,"favourites_count":698,"statuses_count":40217,"created_at":"Fri Jun 26 13:51:32 +0000 2009","utc_offset":-7200,"time_zone":"Brasilia","geo_enabled":true,"lang":"pt","contributors_enabled":false,"is_translator":false,"profile_background_color":"FCFFFF","p rofile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/489137936269447168\/wrgvbWBc.png","profile_background_image_url_https":"https:\/\/ pbs.twimg.com\/profile_background_images\/489137936269447168\/ wrgvbWBc.png","profile_background_tile":true,"profile_link_color":"B3002D","profile_sidebar_border_color":"FFFFFF","profile_sidebar_fill_color":"FFCCDF","profile_text_c olor":"333333","profile_use_background_image":true,"profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/520948025435230209\/ Hi20Any4_normal.png","profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/520948025435230209\/Hi20Any4_normal.png","profile_banner_url":"https:\/\/ pbs.twimg.com\/profile_banners\/51064768\/ 1450108382","default_profile":false,"default_profile_image":false,"following":null,"follow_request_sent":null,"notifications":null},"geo":null,"coordinates":null,"place ":null,"contributors":null,"is_quote_status":false,"retweet_count":0,"favorite_count":0,"entities":{"hashtags":[],"urls":[],"user_mentions":[],"symbols":[],"media": [{"id":676403904230375425,"id_str":"676403904230375425","indices":[117,140],"media_url":"http:\/\/pbs.twimg.com\/media\/CWMRxGRWwAEBicv.png","media_url_https":"https:\/ \/pbs.twimg.com\/media\/CWMRxGRWwAEBicv.png","url":"https:\/\/t.co\/wx659Rc0po","display_url":"pic.twitter.com\/wx659Rc0po","expanded_url":"http:\/\/twitter.com\/ Fatima_Bezerra\/status\/676403905891344385\/photo\/1","type":"photo","sizes":{"small":{"w":340,"h":340,"resize":"fit"},"thumb":{"w":150,"h": 150,"resize":"crop"},"medium":{"w":600,"h":600,"resize":"fit"},"large":{"w":600,"h":600,"resize":"fit"}}}]},"extended_entities":{"media":[{"id": 676403904230375425,"id_str":"676403904230375425","indices":[117,140],"media_url":"http:\/\/pbs.twimg.com\/media\/CWMRxGRWwAEBicv.png","media_url_https":"https:\/\/ pbs.twimg.com\/media\/CWMRxGRWwAEBicv.png","url":"https:\/\/t.co\/wx659Rc0po","display_url":"pic.twitter.com\/wx659Rc0po","expanded_url":"http:\/\/twitter.com\/ Fatima_Bezerra\/status\/676403905891344385\/photo\/1","type":"photo","sizes":{"small":{"w":340,"h":340,"resize":"fit"},"thumb":{"w":150,"h": 150,"resize":"crop"},"medium":{"w":600,"h":600,"resize":"fit"},"large":{"w":600,"h": 600,"resize":"fit"}}}]},"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"pt"},"is_quote_status":true,"retweet_count": 2,"favorite_count":0,"entities":{"hashtags":[{"text":"FicaDilma","indices":[30,40]}],"urls":[{"url":"https:\/\/t.co\/nTdIgJMCqT","expanded_url":"https:\/\/twitter.com\/ Fatima_Bezerra\/status\/676403905891344385","display_url":"twitter.com\/Fatima_Bezerra\u2026","indices":[107,130]}],"user_mentions": [{"screen_name":"dilmabr","name":"Dilma Rousseff","id":131574396,"id_str":"131574396","indices":[20,28]}],"symbols": []},"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"pt"},"is_quote_status":true,"retweet_count":0,"favorite_count": 0,"entities":{"hashtags":[{"text":"FicaDilma","indices":[51,61]}],"urls":[{"url":"https:\/\/t.co\/nTdIgJMCqT","expanded_url":"https:\/\/twitter.com\/Fatima_Bezerra\/ status\/676403905891344385","display_url":"twitter.com\/Fatima_Bezerra\u2026","indices":[139,140]}],"user_mentions":[{"screen_name":"BetinhoJose_Rec","name":"BETINHO JOS\u00c9","id":1467660972,"id_str":"1467660972","indices":[3,19]},{"screen_name":"dilmabr","name":"Dilma Rousseff","id":131574396,"id_str":"131574396","indices": [41,49]}],"symbols":[]},"favorited":false,"retweeted":false,"possibly_sensitive":false,"filter_level":"low","lang":"pt","timestamp_ms":"1450148384942"}
  11. { "created_at":"Tue Dec 15 02:59:44 +0000 2015", "id":676597482013487104, "id_str":"676597482013487104", "text":"RT

    @BetinhoJose_Rec: Parab\u00e9ns presidenta @dilmabr! #FicaDilma mais seja firme com a for \u00e7a da mulher guerreira que a senhora \u00e9! https:\/\/t.c\u2026", "source":"\u003ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a\u003e", "truncated":false, "in_reply_to_status_id":null, "in_reply_to_status_id_str":null, "in_reply_to_user_id":null, "in_reply_to_user_id_str":null, "in_reply_to_screen_name":null, "user":{ "id":861617935, "id_str":"861617935", "name":"Dursilvanribeiro", "screen_name":"Dudurrauer", "location":null, "url":null, "description":null, "protected":false, "verified":false, "followers_count":367, "friends_count":709, "listed_count":0, "favourites_count":6, "statuses_count":708, "created_at":"Thu Oct 04 15:53:21 +0000 2012", "utc_offset":null, "time_zone":null, "geo_enabled":false, "lang":"pt", "contributors_enabled":false, "is_translator":false, "profile_background_color":"C0DEED", "profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png", "profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png", "profile_background_tile":false, "profile_link_color":"0084B4",
  12. "expanded_url":"https:\/\/twitter.com\/Fatima_Bezerra\/status\/676403905891344385", "display_url":"twitter.com\/Fatima_Bezerra\u2026", "indices":[ 139, 140 ] } ], "user_mentions":[ {

    "screen_name":"BetinhoJose_Rec", "name":"BETINHO JOS\u00c9", "id":1467660972, "id_str":"1467660972", "indices":[ 3, 19 ] }, { "screen_name":"dilmabr", "name":"Dilma Rousseff", "id":131574396, "id_str":"131574396", "indices":[ 41, 49 ] } ], "symbols":[ ] }, "favorited":false, "retweeted":false, "possibly_sensitive":false, "filter_level":"low", "lang":"pt", "timestamp_ms":"1450148384942" }
  13. { "created_at":"Tue Dec 15 02:59:44 +0000 2015", "id":676597482013487104, "id_str":"676597482013487104", "text":"RT

    @BetinhoJose_Rec: Parab\u00e9ns presidenta @dilmabr! #FicaDilma mais seja firme com a for\u00e7a da mulher guerreira que a senhora \u00e9! https:\/\/t.c\u2026", "source":"\u003ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a\u003e", "truncated":false, "in_reply_to_status_id":null, "in_reply_to_status_id_str":null, "in_reply_to_user_id":null, "in_reply_to_user_id_str":null, "in_reply_to_screen_name":null, "user":{ "id":861617935, "id_str":"861617935", "name":"Dursilvanribeiro", "screen_name":"Dudurrauer", "location":null, "url":null, "description":null, "protected":false, "verified":false, "followers_count":367, "friends_count":709, "listed_count":0, "favourites_count":6, "statuses_count":708, "created_at":"Thu Oct 04 15:53:21 +0000 2012", "utc_offset":null, "time_zone":null, "geo_enabled":false, "lang":"pt", "contributors_enabled":false, "is_translator":false, "profile_background_color":"C0DEED", "profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png", "profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png", "profile_background_tile":false, "profile_link_color":"0084B4", "profile_sidebar_border_color":"C0DEED", "profile_sidebar_fill_color":"DDEEF6", "profile_text_color":"333333", "profile_use_background_image":true, "profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/2681381838\/37fcfa873468f095360694222e3df899_normal.jpeg", "profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/2681381838\/37fcfa873468f095360694222e3df899_normal.jpeg", "default_profile":true, "default_profile_image":false, "following":null, "follow_request_sent":null, "notifications":null }, "geo":null, "coordinates":null, "place":null, "contributors":null, "retweeted_status":{ "created_at":"Mon Dec 14 16:37:27 +0000 2015", "id":676440878446153728, "id_str":"676440878446153728", "text":"Parab\u00e9ns presidenta @dilmabr! #FicaDilma mais seja firme com a for\u00e7a da mulher guerreira que a senhora \u00e9! https:\/\/t.co\/nTdIgJMCqT", "source":"\u003ca href=\"http:\/\/twitter.com\/download\/android\" rel=\"nofollow\"\u003eTwitter for Android\u003c\/a\u003e", "truncated":false, "in_reply_to_status_id":null, "in_reply_to_status_id_str":null, "in_reply_to_user_id":null, "in_reply_to_user_id_str":null, "in_reply_to_screen_name":null, "user":{ "id":1467660972, "id_str":"1467660972", "name":"BETINHO JOS\u00c9", "screen_name":"BetinhoJose_Rec", "location":"Recife - Pernambuco", "url":"https:\/\/www.facebook.com\/pages\/Betinho-Jos%C3%A9\/552364058251241?fref=ts#", "description":"Sou educador social, blogueiro, radialista, profissional de r\u00e1dio e TV", "protected":false, "verified":false, "followers_count":447, "friends_count":1973, "listed_count":3, "favourites_count":450, "statuses_count":5496, "created_at":"Wed May 29 16:27:56 +0000 2013", "utc_offset":-7200, "time_zone":"Brasilia", "geo_enabled":true, "lang":"pt", "contributors_enabled":false, "is_translator":false, "profile_background_color":"000000", "profile_background_image_url":"http:\/\/abs.twimg.com\/images\/themes\/theme19\/bg.gif", "profile_background_image_url_https":"https:\/\/abs.twimg.com\/images\/themes\/theme19\/bg.gif", "profile_background_tile":false, "profile_link_color":"3B94D9", "profile_sidebar_border_color":"000000", "profile_sidebar_fill_color":"000000", "profile_text_color":"000000", "profile_use_background_image":false, "profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/676458441288871937\/HsPqvwr3_normal.jpg", "profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/676458441288871937\/HsPqvwr3_normal.jpg", "profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/1467660972\/1446509862", "default_profile":false, "default_profile_image":false, "following":null, "follow_request_sent":null, "notifications":null }, "geo":null, "coordinates":null, "place":null, "contributors":null, "quoted_status_id":676403905891344385, "quoted_status_id_str":"676403905891344385", "quoted_status":{ "created_at":"Mon Dec 14 14:10:32 +0000 2015", "id":676403905891344385, "id_str":"676403905891344385", "text":"(A) Feliz anivers\u00e1rio, presidenta! Que este cora\u00e7\u00e3o valente continue lutando pela democracia e pelo Brasil. Q honra! https:\/\/t.co\/wx659Rc0po", "source":"\u003ca href=\"http:\/\/twitter.com\" rel=\"nofollow\"\u003eTwitter Web Client\u003c\/a\u003e", "truncated":false, "in_reply_to_status_id":null, "in_reply_to_status_id_str":null, "in_reply_to_user_id":null, "in_reply_to_user_id_str":null, "in_reply_to_screen_name":null, "user":{ "id":51064768, "id_str":"51064768", "name":"F\u00e1tima Bezerra", "screen_name":"Fatima_Bezerra", "location":"Rio Grande do Norte", "url":"http:\/\/www.fatimabezerra.com.br", "description":"F\u00e1tima \u00e9 professora e senadora eleita em 2014 com 808.055 votos no RN.", "protected":false, "verified":false, "followers_count":49982, "friends_count":1047, "listed_count":385, "favourites_count":698, "statuses_count":40217, "created_at":"Fri Jun 26 13:51:32 +0000 2009", "utc_offset":-7200, "time_zone":"Brasilia", "geo_enabled":true, "lang":"pt", "contributors_enabled":false, "is_translator":false, "profile_background_color":"FCFFFF", "profile_background_image_url":"http:\/\/pbs.twimg.com\/profile_background_images\/489137936269447168\/wrgvbWBc.png", "profile_background_image_url_https":"https:\/\/pbs.twimg.com\/profile_background_images\/489137936269447168\/wrgvbWBc.png", "profile_background_tile":true, "profile_link_color":"B3002D", "profile_sidebar_border_color":"FFFFFF", "profile_sidebar_fill_color":"FFCCDF", "profile_text_color":"333333", "profile_use_background_image":true, "profile_image_url":"http:\/\/pbs.twimg.com\/profile_images\/520948025435230209\/Hi20Any4_normal.png", "profile_image_url_https":"https:\/\/pbs.twimg.com\/profile_images\/520948025435230209\/Hi20Any4_normal.png", "profile_banner_url":"https:\/\/pbs.twimg.com\/profile_banners\/51064768\/1450108382", "default_profile":false, "default_profile_image":false, "following":null, "follow_request_sent":null, "notifications":null }, "geo":null, "coordinates":null, "place":null, "contributors":null, "is_quote_status":false, "retweet_count":0, "favorite_count":0, "entities":{ "hashtags":[ ], "urls":[ ], "user_mentions":[ ], "symbols":[ ], "media":[ { "id":676403904230375425, "id_str":"676403904230375425", "indices":[ 117, 140 ], "media_url":"http:\/\/pbs.twimg.com\/media\/CWMRxGRWwAEBicv.png", "media_url_https":"https:\/\/pbs.twimg.com\/media\/CWMRxGRWwAEBicv.png", "url":"https:\/\/t.co\/wx659Rc0po", "display_url":"pic.twitter.com\/wx659Rc0po", "expanded_url":"http:\/\/twitter.com\/Fatima_Bezerra\/status\/676403905891344385\/photo\/1", "type":"photo", "sizes":{ "small":{ "w":340, "h":340, "resize":"fit" }, "thumb":{ "w":150, "h":150, "resize":"crop" }, "medium":{ "w":600, "h":600, "resize":"fit" }, "large":{ "w":600, "h":600, "resize":"fit" } } } ] }, "extended_entities":{ "media":[ { "id":676403904230375425, "id_str":"676403904230375425", "indices":[ 117, 140 ], "media_url":"http:\/\/pbs.twimg.com\/media\/CWMRxGRWwAEBicv.png", "media_url_https":"https:\/\/pbs.twimg.com\/media\/CWMRxGRWwAEBicv.png", "url":"https:\/\/t.co\/wx659Rc0po", "display_url":"pic.twitter.com\/wx659Rc0po", "expanded_url":"http:\/\/twitter.com\/Fatima_Bezerra\/status\/676403905891344385\/photo\/1", "type":"photo", "sizes":{ "small":{ "w":340, "h":340, "resize":"fit" }, "thumb":{ "w":150, "h":150, "resize":"crop" }, "medium":{ "w":600, "h":600, "resize":"fit" }, "large":{ "w":600, "h":600, "resize":"fit" } } } ] }, "favorited":false, "retweeted":false, "possibly_sensitive":false, "filter_level":"low", "lang":"pt" }, "is_quote_status":true, "retweet_count":2, "favorite_count":0, "entities":{ "hashtags":[ { "text":"FicaDilma", "indices":[ 30, 40 ] } ], "urls":[ { "url":"https:\/\/t.co\/nTdIgJMCqT", "expanded_url":"https:\/\/twitter.com\/Fatima_Bezerra\/status\/676403905891344385", "display_url":"twitter.com\/Fatima_Bezerra\u2026", "indices":[ 107, 130 ] } ], "user_mentions":[ { "screen_name":"dilmabr", "name":"Dilma Rousseff", "id":131574396, "id_str":"131574396", "indices":[ 20, 28 ] } ], "symbols":[ ] }, "favorited":false, "retweeted":false, "possibly_sensitive":false, "filter_level":"low", "lang":"pt" }, "is_quote_status":true, "retweet_count":0, "favorite_count":0, "entities":{ "hashtags":[ { "text":"FicaDilma", "indices":[ 51, 61 ] } ], "urls":[ { "url":"https:\/\/t.co\/nTdIgJMCqT", "expanded_url":"https:\/\/twitter.com\/Fatima_Bezerra\/status\/676403905891344385", "display_url":"twitter.com\/Fatima_Bezerra\u2026", "indices":[ 139, 140 ] } ], "user_mentions":[ { "screen_name":"BetinhoJose_Rec", "name":"BETINHO JOS\u00c9", "id":1467660972, "id_str":"1467660972", "indices":[ 3, 19 ] }, { "screen_name":"dilmabr", "name":"Dilma Rousseff", "id":131574396, "id_str":"131574396", "indices":[ 41, 49 ] } ], "symbols":[ ] }, "favorited":false, "retweeted":false, "possibly_sensitive":false, "filter_level":"low", "lang":"pt", "timestamp_ms":"1450148384942" }
  14. $ mongo MongoDB shell version: 3.2.4 connecting to: test cliente

    > show collections classification_201611181000 classification_201611201303 classification_201611201323 total tweets tweets_classificados tweets_classificados_201611162016 tweets_classificados_apo_201611170606 tweets_classificados_enq_201611162140 words > use impeachment switched to db impeachment > show dbs chile 0.086GB impeachment 3.195GB local 0.000GB test 0.005GB
  15. $ mongoimport --db dojo20161125 --collection tweets --file impeachment-sampling-1000tweets.json 2016-11-25T11:58:33.755-0200 connected

    to: localhost 2016-11-25T11:58:34.706-0200 imported 1000 documents carga da base Arquivo disponível em: https://github.com/code4pol/lab-20161125-mongodb-1
  16. $ mongoimport --db dojo20161125 --collection tweets --file impeachment-sampling-1000tweets.json 2016-11-25T11:58:33.755-0200 connected

    to: localhost 2016-11-25T11:58:34.706-0200 imported 1000 documents carga da base > show collections tweets > use dojo20161125 switched to db dojo20161125 > show dbs chile 0.086GB dojo20161125 0.002GB impeachment 3.197GB local 0.000GB test 0.005GB > db.tweets.count() 1000
  17. busca por tweets > db.tweets.findOne() { "_id" : ObjectId("582ce5a9a6e51390b3d62947"), "created_at"

    : "Thu Sep 01 15:17:16 +0000 2016", "id" : NumberLong("771366319874859008"), "id_str" : "771366319874859008", "text" : "RT @CFKArgentina: Se consumó en Brasil el golpe institucional: Nueva forma de violentar la soberanía popular. #dilmarousseff", "source" : "<a href=\"http://twitter.com/download/android\" rel= \"nofollow\">Twitter for Android</a>", "truncated" : false, "in_reply_to_status_id" : null, "in_reply_to_status_id_str" : null, "in_reply_to_user_id" : null, "in_reply_to_user_id_str" : null, "in_reply_to_screen_name" : null, "user" : { "id" : 147225872, "id_str" : "147225872", "name" : "Luis Edelman", "screen_name" : "Luis_Edelman", "location" : "Rosario ", "url" : null, "description" : "Rosarino por adopción. Latinoamericano por convicción. Taragüi", "protected" : false, "verified" : false,
  18. busca por tweets > db.tweets.find() { "_id" : ObjectId("582ce5a9a6e51390b3d62947"), "created_at"

    : "Thu Sep 01 15:17:16 +0000 2016", "id" : NumberLong("771366319874859008"), "id_str" : "771366319874859008", "text" : "RT @CFKArgentina: Se consumó en Brasil el golpe institucional: Nueva forma de violentar la soberanía popular. #dilmarousseff", "source" : "<a href=\"http:// twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</ a>”(…)JOAQUINTDASILVA", "name" : "JOAQUIN TEIXEIRA", "id" : 464128120 "id_str" : "464128120", "indices" : [ 3, 19 ] } ], "symbols" : [ ] }, "favorited" : false, "retweeted" : false, "filter_level" : "low", "lang" : "pt", "timestamp_ms" : "1460809408937", "created_at_as_date" : ISODate("2016-04-16T12:23:28Z") } Type "it" for more > it { "_id" : ObjectId("582ce439a6e51390b3cf585c"), "created_at" : "Wed Aug 31 15:28:17 +0000 2016", "id" : NumberLong("771006702502154241"), "id_str" : "771006702502154241", "text" : "RT @RodP13: Globo já é tratada como golpista mundo a fora. \n#ImpeachmentDay = Dia da Vergonha.\nGolpe da mídia com os corruptos. https://t.c…", "source" : "<a href=\"https://mobile.twitter.com\" rel=\"nofollow\">Mobile Web (M5)</a>", "truncated" : false, "in_reply_to_status_id" : null, "in_reply_to_status_id_str" : null, "in_reply_to_user_id" : null, "in_reply_to_user_id_str" : null, "in_reply_to_screen_name" : null, "user" : { "id" : 208880538, "id_str" : "208880538", "name" : "Belle Vox", "screen_name" : "BelleVox", "location" : "Brasil - São Paulo",
  19. busca por tweets > db.tweets.find( { 'id': 771366319874859008 } )

    { "_id" : ObjectId("582ce5a9a6e51390b3d62947"), "created_at" : "Thu Sep 01 15:17:16 +0000 2016", "id" : NumberLong("771366319874859008"), "id_str" : "771366319874859008", "text" : "RT @CFKArgentina: Se consumó en Brasil el golpe institucional: Nueva forma de violentar la soberanía popular. #dilmarousseff", "source" : "<a href=\"http:// twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</ a>", "truncated" : false, "in_reply_to_status_id" : null, "in_reply_to_status_id_str" : null, "in_reply_to_user_id" : null, "in_reply_to_user_id_str" : null, "in_reply_to_screen_name" : null, "user" : { "id" : 147225872, "id_str" : "147225872", "name" : "Luis Edelman", "screen_name" : "Luis_Edelman", "location" : "Rosario “ (…)
  20. busca por tweets > db.tweets.find( { 'created_at' : "Thu Sep

    01 15:17:16 +0000 2016" } ) { "_id" : ObjectId("582ce5a9a6e51390b3d62947"), "created_at" : "Thu Sep 01 15:17:16 +0000 2016", "id" : NumberLong("771366319874859008"), "id_str" : "771366319874859008", "text" : "RT @CFKArgentina: Se consumó en Brasil (...) > db.tweets.find( { 'user.screen_name' : 'Luis_Edelman' } ) { "_id" : ObjectId("582ce5a9a6e51390b3d62947"), "created_at" : "Thu Sep 01 15:17:16 +0000 2016", "id" : NumberLong("771366319874859008"), "id_str" : "771366319874859008", "text" : "RT @CFKArgentina: Se consumó en Brasil el golpe institucional: Nueva forma de violentar la soberanía popular. #dilmarousseff", "source" : "<a href=\"http://twitter.com/ download/android\" rel=\"nofollow\">Twitter for Android</a>", "truncated" : false, "in_reply_to_status_id" : null, "in_reply_to_status_id_str" : null, "in_reply_to_user_id" : null, "in_reply_to_user_id_str" : null, "in_reply_to_screen_name" : null, "user" : { "id" : 147225872, "id_str" : "147225872", "name" : "Luis Edelman", "screen_name" : "Luis_Edelman", "location" : "Rosario ",
  21. busca por tweets > db.tweets.find( { 'user.screen_name' : 'FernandoCesar77' }

    ).count() 1 > db.tweets.find( { 'user.screen_name' : 'FernandoCesar77' } ).next() { "_id" : ObjectId("582ce448a6e51390b3cf905a"), "created_at" : "Wed Aug 31 16:24:44 +0000 2016", "id" : NumberLong("771020911868841985"), "id_str" : "771020911868841985", "text" : "RT @erikakokay: O que aconteceu com o julgamento de Jango em 64? Foi anulado pelo mesmo Senado que hoje golpeará a democracia novamente! #i…", "source" : "<a href=\"http://twitter.com/#!/download/ipad\" rel= \"nofollow\">Twitter for iPad</a>", "truncated" : false, "in_reply_to_status_id" : null, "in_reply_to_status_id_str" : null, "in_reply_to_user_id" : null, "in_reply_to_user_id_str" : null, "in_reply_to_screen_name" : null, "user" : { "id" : 22735093, "id_str" : "22735093", "name" : "Fernando Cesar", "screen_name" : "FernandoCesar77", "location" : "Brasil",
  22. busca por tweets > db.tweets.find( { 'id': 771366319874859008 } ).count()

    1 > db.tweets.find( { 'id': { $gt: 770000000000000000 } }).count() 708 > db.tweets.find( { 'id': { $lt: 770000000000000000 } }).count() 292 > db.tweets.find( { 'lang': 'pt' }).count() 544 > db.tweets.find( {'lang' : 'pt', 'is_quote_status' : true}).count() 62 > db.tweets.find({ $or : [ {'lang':'pt'},{'is_quote_status':true} ]}).count() 597 > db.tweets.find({$or : [ {'lang':'pt'},{'is_quote_status':true} ], 'user.screen_name':'maibdom'}).count() 1
  23. AND db.tweets.find( ) db.tweets.find( {} ) db.tweets.find( { chave:valor, chave:valor

    } ) https://docs.mongodb.com/manual/reference/operator/query/and/#op._S_and db.tweets.find( { $and : [] } ) db.tweets.find( { $and : [{},{}] } ) db.tweets.find( { $and : [{c:v},{c:v}] } ) db.tweets.find( { $and : [ {'lang' : ‘pt’}, {'is_quote_status' : true} ] })
  24. OR db.tweets.find( ) db.tweets.find( {} ) db.tweets.find( { $or :

    [] } ) db.tweets.find( { $or : [{},{}] } ) db.tweets.find( { $or : [ {'lang' : 'pt'}, {'is_quote_status' : true} ] }) https://docs.mongodb.com/manual/reference/operator/query/or/#op._S_or
  25. OR + AND > db.tweets.find( { $or : [ {

    'lang' : 'pt' }, {'is_quote_status' : true } ], 'user.screen_name': 'maibdom' }) > db.tweets.find( { $and : [ {$or : [ { 'lang' : 'pt' }, {'is_quote_status' : true } ]}, {'user.screen_name': ‘maibdom’} ] })
  26. IN > db.tweets.find( { $or : [ { 'lang' :

    'pt' }, { 'lang' : 'es' } ] }).count() 984 > db.tweets.find({'lang' : 'pt'}).count() 544 > db.tweets.find({'lang' : 'es'}).count() 440 > db.tweets.find({'lang':{$in : ['pt','es'] }}).count() 984
  27. Projeção > db.tweets.find( { 'id': 771366319874859008 } ) { "_id"

    : ObjectId("582ce5a9a6e51390b3d62947"), "created_at" : "Thu Sep 01 15:17:16 +0000 2016", "id" : NumberLong("771366319874859008"), "id_str" : "771366319874859008", "text" : "RT @CFKArgentina: Se consumó en Brasil el golpe institucional: Nueva forma de violentar la soberanía popular. #dilmarousseff", "source" : "<a href=\"http://twitter.com/download/ android\" rel=\"nofollow\">Twitter for Android</a>", "truncated" : false, "in_reply_to_status_id" : null, "in_reply_to_status_id_str" : null, "in_reply_to_user_id" : null, "in_reply_to_user_id_str" : null, "in_reply_to_screen_name" : null, "user" : { "id" : 147225872, "id_str" : "147225872", "name" : "Luis Edelman", "screen_name" : "Luis_Edelman", "location" : "Rosario ", "url" : null, "description" : "Rosarino por adopción. Latinoamericano por convicción. Taragüi", "protected" : false, "verified" : false, "followers_count" : 1126, "friends_count" : 1576, "listed_count" : 22, "favourites_count" : 3095, "statuses_count" : 17494, "created_at" : "Sun May 23 15:01:05 +0000 2010", "utc_offset" : -10800, "time_zone" : "Buenos Aires", "geo_enabled" : true, "lang" : "es", "contributors_enabled" : false, "is_translator" : false, "profile_background_color" : "B2DFDA", "profile_background_image_url" : "http://pbs.twimg.com/profile_background_images/833079358/ de32f123d347d896ded370ae1c60e316.jpeg", "profile_background_image_url_https" : "https://pbs.twimg.com/profile_background_images/ 833079358/de32f123d347d896ded370ae1c60e316.jpeg", "profile_background_tile" : false, "profile_link_color" : "93A644", "profile_sidebar_border_color" : "FFFFFF", "profile_sidebar_fill_color" : "DDE016", "profile_text_color" : "050505", "profile_use_background_image" : true, "profile_image_url" : "http://pbs.twimg.com/profile_images/744168962963939328/ C828lOfZ_normal.jpg", "profile_image_url_https" : "https://pbs.twimg.com/profile_images/744168962963939328/C828lOfZ_normal.jpg", "profile_banner_url" : "https://pbs.twimg.com/profile_banners/147225872/1466947702", "default_profile" : false, "default_profile_image" : false, "following" : null, "follow_request_sent" : null, "notifications" : null }, "geo" : null, "coordinates" : null, "place" : null, "contributors" : null, "retweeted_status" : { "created_at" : "Wed Aug 31 19:13:33 +0000 2016", "id" : NumberLong("771063395210649600"), "id_str" : "771063395210649600", "text" : "Se consumó en Brasil el golpe institucional: Nueva forma de violentar la soberanía popular. #dilmarousseff", "source" : "<a href=\"http://twitter.com\" rel= \"nofollow\">Twitter Web Client</a>", "truncated" : false, "in_reply_to_status_id" : null, "in_reply_to_status_id_str" : null, "in_reply_to_user_id" : null, "in_reply_to_user_id_str" : null, "in_reply_to_screen_name" : null, "user" : { "id" : 138814032, "id_str" : "138814032", "name" : "Cristina Kirchner", "screen_name" : "CFKArgentina", "location" : "Argentina", "url" : "http:// www.cfkargentina.com", "description" : "Cristina Fernández de Kirchner, militante peronista, ex Presidenta de la Nación Argentina. En facebook: http://www.facebook.com/CFKArgentina", "protected" : false, "verified" : true, "followers_count" : 4608293, "friends_count" : 121, "listed_count" : 15020, "favourites_count" : 16, "statuses_count" : 9604, "created_at" : "Fri Apr 30 17:36:51 +0000 2010", "utc_offset" : -10800, "time_zone" : "Buenos Aires", "geo_enabled" : false, "lang" : "es", "contributors_enabled" : false, "is_translator" : false, "profile_background_color" : "AB48F2", "profile_background_image_url" : "http://pbs.twimg.com/profile_background_images/678962478416556033/5VDvwCKM.jpg", "profile_background_image_url_https" : "https:// pbs.twimg.com/profile_background_images/678962478416556033/5VDvwCKM.jpg", "profile_background_tile" : false, "profile_link_color" : "007BFF", "profile_sidebar_border_color" : "FFFFFF", "profile_sidebar_fill_color" : "E4EBF2", "profile_text_color" : "BE14C7", "profile_use_background_image" : true, "profile_image_url" : "http://pbs.twimg.com/profile_images/1112014698/ foto6-3.jpg_1__normal.jpg", "profile_image_url_https" : "https://pbs.twimg.com/profile_images/1112014698/ foto6-3.jpg_1__normal.jpg", "profile_banner_url" : "https://pbs.twimg.com/profile_banners/138814032/1450712620", "default_profile" : false, "default_profile_image" : false, "following" : null, "follow_request_sent" : null, "notifications" : null }, "geo" : null, "coordinates" : null, "place" : null, "contributors" : null, "is_quote_status" : false, "retweet_count" : 5107, "favorite_count" : 4612, "entities" : { "hashtags" : [ { "text" : "dilmarousseff", "indices" : [ 92, 106 ] } ], "urls" : [ ], "user_mentions" : [ ], "symbols" : [ ] }, "favorited" : false, "retweeted" : false, "filter_level" : "low", "lang" : "es" }, "is_quote_status" : false, "retweet_count" : 0, "favorite_count" : 0, "entities" : { "hashtags" : [ { "text" : "dilmarousseff", "indices" : [ 110, 124 ] } ], "urls" : [ ], "user_mentions" : [ { "screen_name" : "CFKArgentina", "name" : "Cristina Kirchner", "id" : 138814032, "id_str" : "138814032", "indices" : [ 3, 16 ] } ], "symbols" : [ ] }, "favorited" : false, "retweeted" : false, "filter_level" : "low", "lang" : "es", "timestamp_ms" : "1472743036608", "created_at_as_date" : ISODate("2016-09-01T15:17:16Z") }
  28. Projeção > db.tweets.find( { 'id': 771366319874859008 } ).next() { "_id"

    : ObjectId("582ce5a9a6e51390b3d62947"), "created_at" : "Thu Sep 01 15:17:16 +0000 2016", "id" : NumberLong("771366319874859008"), "id_str" : "771366319874859008", "text" : "RT @CFKArgentina: Se consumó en Brasil el golpe institucional: Nueva forma de violentar la soberanía popular. #dilmarousseff", "source" : "<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>", "truncated" : false, "in_reply_to_status_id" : null, "in_reply_to_status_id_str" : null, "in_reply_to_user_id" : null, "in_reply_to_user_id_str" : null, "in_reply_to_screen_name" : null, "user" : { "id" : 147225872, "id_str" : "147225872", "name" : "Luis Edelman", "screen_name" : "Luis_Edelman", "location" : "Rosario ", "url" : null, "description" : "Rosarino por adopción. Latinoamericano por convicción. Taragüi", "protected" : false, "verified" : false, "followers_count" : 1126, "friends_count" : 1576, "listed_count" : 22, "favourites_count" : 3095, "statuses_count" : 17494, "created_at" : "Sun May 23 15:01:05 +0000 2010", "utc_offset" : -10800, "time_zone" : "Buenos Aires", "geo_enabled" : true, "lang" : "es", "contributors_enabled" : false, "is_translator" : false, "profile_background_color" : "B2DFDA", "profile_background_image_url" : "http://pbs.twimg.com/profile_background_images/833079358/ de32f123d347d896ded370ae1c60e316.jpeg", "profile_background_image_url_https" : "https://pbs.twimg.com/profile_background_images/833079358/ de32f123d347d896ded370ae1c60e316.jpeg", "profile_background_tile" : false, "profile_link_color" : "93A644", "profile_sidebar_border_color" : "FFFFFF", "profile_sidebar_fill_color" : "DDE016", "profile_text_color" : "050505", "profile_use_background_image" : true,
  29. Projeção > db.tweets.find( { 'id' : 771366319874859008}, { 'id': true,

    'text' : true} ).next() { "_id" : ObjectId("582ce5a9a6e51390b3d62947"), "id" : NumberLong("771366319874859008"), "text" : "RT @CFKArgentina: Se consumó en Brasil el golpe (…)" } > db.tweets.find( { 'id' : 771366319874859008}, { ‘_id’: false, ’id': true, 'text' : true} ).next() { "id" : NumberLong("771366319874859008"), "text" : "RT @CFKArgentina: Se consumó en Brasil el golpe (…)" } > db.tweets.find( {} ) > db.tweets.find( {}, {} )
  30. Datas > db.tweets.find( { ‘created_at' : "Thu Sep 01 15:17:16

    +0000 2016" } ).count() 1 > db.tweets.find( { 'created_at' : { $gt : ”Thu Sep 01 15:17:16 +0000 2016" } } ).count() 649 > db.tweets.find( { 'created_at' : { $gt : ”Thu Sep 01 15:17:16 +0000 2016" } }, { 'created_at' : true} ) { "_id" : ObjectId("582ce48da6e51390b3d0ea72"), "created_at" : "Wed Aug 31 17:37:04 +0000 2016" } { "_id" : ObjectId("582ce4e8a6e51390b3d2dda7"), "created_at" : "Wed Aug 31 20:13:05 +0000 2016" } { "_id" : ObjectId("582ce556a6e51390b3d4840a"), "created_at" : "Wed Aug 31 23:18:17 +0000 2016" } { "_id" : ObjectId("582ce6bda6e51390b3d7e27f"), "created_at" : "Thu Sep 01 22:42:24 +0000 2016" } { "_id" : ObjectId("582ce658a6e51390b3d74b09"), "created_at" : "Thu Sep 01 19:46:37 +0000 2016" } { "_id" : ObjectId("582ce400a6e51390b3ce72ed"), "created_at" : "Wed Aug 31 03:58:20 +0000 2016" } { "_id" : ObjectId("582ce4b7a6e51390b3d1db91"), "created_at" : "Wed Aug 31 18:48:26 +0000 2016" } { "_id" : ObjectId("582ce4d8a6e51390b3d28b81"), "created_at" : "Wed Aug 31 19:45:21 +0000 2016" }
  31. Datas { "_id" : ObjectId("582ce48da6e51390b3d0ea72"), "created_at" : "Wed Aug 31

    17:37:04 +0000 2016" } { "_id" : ObjectId("582ce4e8a6e51390b3d2dda7"), "created_at" : "Wed Aug 31 20:13:05 +0000 2016" } { "_id" : ObjectId("582ce556a6e51390b3d4840a"), "created_at" : "Wed Aug 31 23:18:17 +0000 2016" } { "_id" : ObjectId("582ce6bda6e51390b3d7e27f"), "created_at" : "Thu Sep 01 22:42:24 +0000 2016" } { "_id" : ObjectId("582ce658a6e51390b3d74b09"), "created_at" : "Thu Sep 01 19:46:37 +0000 2016" } { "_id" : ObjectId("582ce400a6e51390b3ce72ed"), "created_at" : "Wed Aug 31 03:58:20 +0000 2016" } { "_id" : ObjectId("582ce4b7a6e51390b3d1db91"), "created_at" : "Wed Aug 31 18:48:26 +0000 2016" } { "_id" : ObjectId("582ce4d8a6e51390b3d28b81"), "created_at" : "Wed Aug 31 19:45:21 +0000 2016" } { "_id" : ObjectId("582ce5baa6e51390b3d669a2"), "created_at" : "Thu Sep 01 16:08:39 +0000 2016" } { "_id" : ObjectId("582ce659a6e51390b3d75216"), "created_at" : "Thu Sep 01 19:54:53 +0000 2016" } { "_id" : ObjectId("582ce483a6e51390b3d0bc1c"), "created_at" : "Wed Aug 31 17:27:04 +0000 2016" } { "_id" : ObjectId("582ce52da6e51390b3d3d8fd"), "created_at" : "Wed Aug 31 22:00:18 +0000 2016" } { "_id" : ObjectId("582ce42fa6e51390b3cf27f3"), "created_at" : "Wed Aug 31 14:34:48 +0000 2016" } { "_id" : ObjectId("582ce4e5a6e51390b3d2d644"), "created_at" : "Wed Aug 31 20:10:31 +0000 2016" } { "_id" : ObjectId("582ce394a6e51390b3cc6032"), "created_at" : "Tue Aug 30 09:21:33 +0000 2016" } { "_id" : ObjectId("582ce442a6e51390b3cf7ec8"), "created_at" : "Wed Aug 31 16:08:34 +0000 2016" } { "_id" : ObjectId("582ce674a6e51390b3d77bfe"), "created_at" : "Thu Sep 01 20:45:49 +0000 2016" } { "_id" : ObjectId("582ce4aba6e51390b3d18d93"), "created_at" : "Wed Aug 31 18:28:00 +0000 2016" } { "_id" : ObjectId("582ce52da6e51390b3d3d980"), "created_at" : "Wed Aug 31 22:00:33 +0000 2016" } { "_id" : ObjectId("582ce507a6e51390b3d3467f"), "created_at" : "Wed Aug 31 20:54:14 +0000 2016" } String!!!
  32. Javascript no Mongo > d1 = new Date("Wed Aug 31

    21:22:31 +0000 2016") ISODate("2016-08-31T21:22:31Z") > d2 = new Date("Mon Sep 12 21:49:03 +0000 2016") ISODate("2016-09-12T21:49:03Z") > d1 > d2 false > d2 > d1 true > s1 = "Wed Aug 31 21:22:31 +0000 2016" Wed Aug 31 21:22:31 +0000 2016 > s2 = "Mon Sep 12 21:49:03 +0000 2016" Mon Sep 12 21:49:03 +0000 2016 > s1 > s2 true > s2 > s1 false
  33. Datas > db.tweets.find().count() 1000 > tweets = db.tweets.find() > tweets.forEach(function(t){

    print(t.id); } ) NumberLong("771436184723656704") NumberLong("771036595965263872") NumberLong("771105357859024900") NumberLong("770993244951941120") NumberLong("771077729076834304") NumberLong("722108810970669056") NumberLong("722058712446279680") NumberLong("770552025511763968") NumberLong("771016840319500294") NumberLong("771449000977395713") NumberLong("771051929774526469") NumberLong("771105421469810688") NumberLong("722132147906220032") NumberLong("771088730149052416") NumberLong("721675507125862400") NumberLong("771456095734890497") NumberLong("771307421373378561") NumberLong("771027617717837824") NumberLong("771040676742135809")
  34. Datas > db.tweets.find().forEach(function(t){ print(t.created_at); } ) Thu Sep 01 15:17:16

    +0000 2016 Mon Apr 18 18:53:27 +0000 2016 Sat Apr 16 04:20:16 +0000 2016 Wed Aug 31 17:37:04 +0000 2016 Wed Aug 31 20:13:05 +0000 2016 Thu Sep 01 04:24:28 +0000 2016 Wed Aug 31 23:18:17 +0000 2016 Sun Apr 17 00:24:24 +0000 2016 Thu Sep 01 22:42:24 +0000 2016 Sat Apr 16 02:26:05 +0000 2016 Mon Apr 18 11:25:55 +0000 2016 Sun Apr 17 15:51:31 +0000 2016 Thu Sep 01 19:46:37 +0000 2016
  35. Datas > db.tweets.findOne() { "_id" : ObjectId("582ce5a9a6e51390b3d62947"), "created_at" : "Thu

    Sep 01 15:17:16 +0000 2016", "id" : NumberLong("771366319874859008"), "id_str" : "771366319874859008", "text" : "RT @CFKArgentina: Se consumó en Brasil el golpe…”, (...) "created_at_as_date" : ISODate("2016-09-01T15:17:16Z") } > db.tweets.find().forEach( ) function(doc) { } doc.created_at_as_date = new Date(doc.created_at); db.tweets.save(doc);
  36. Datas > tweet = db.tweets.findOne() > tweet.created_at_as_date ISODate("2016-09-01T15:17:16Z") > date.getDay()

    4 > date.getMonth() 8 > date.getYear() 116 > date.getFullYear() 2016 > date.getHours() 12 > date.getMinutes() 17 > date.getSeconds() 16 > date = tweet.created_at_as_date > date.getUTCDay() 4 > date.getUTCMonth() 8 > date.getUTCFullYear() 2016 > date.getUTCHours() 15 > date.getUTCMinutes() 17 > date.getUTCSeconds() 16 (Sun = 0) (Jan = 0) !?!?!
  37. > db.tweets.count() 1000 > db.tweets.find( { "created_at_as_date":"2016-09-01") }).count() 0 >

    db.tweets.find( { "created_at_as_date": ISODate('2016-09-01') }).count() 0 > db.tweets.find( { “created_at_as_date": ISODate('2016-09-01T15:17:16Z') }).count() 1 > db.tweets.find( { "created_at_as_date": { $gt : ISODate('2016-09-01') } }).count() 190 > db.tweets.find( { "created_at_as_date": { $lt : ISODate('2016-09-01') } }).count() 810 Datas
  38. Datas > db.tweets.find( { "created_at_as_date": { $gt : ISODate('2016-04-15'), $lt

    : ISODate("2016-04-16") } } ).count() 0 > db.tweets.find( { "created_at_as_date": { $gt : ISODate('2016-04-16'), $lt : ISODate("2016-04-17") } } ).count() 83 > db.tweets.find( { "created_at_as_date": { $gt : ISODate('2016-04-17'), $lt : ISODate("2016-04-18") } } ).count() 76 > db.tweets.find( { "created_at_as_date": { $gt : ISODate('2016-04-18'), $lt : ISODate("2016-04-19") } } ).count() 133 > db.tweets.find( { "created_at_as_date": { $gt : ISODate('2016-04-19'), $lt : ISODate("2016-04-20") } } ).count() 0 > db.tweets.find( { "created_at_as_date": { $gt : ISODate('2016-08-29'), $lt : ISODate("2016-08-30") } } ).count() 0 > db.tweets.find( { "created_at_as_date": { $gt : ISODate('2016-08-30'), $lt : ISODate("2016-08-31") } } ).count() 154 > db.tweets.find( { "created_at_as_date": { $gt : ISODate('2016-08-31'), $lt : ISODate("2016-09-01") } } ).count() 364 > db.tweets.find( { "created_at_as_date": { $gt : ISODate('2016-09-01'), $lt : ISODate("2016-09-02") } } ).count() 190 > db.tweets.find( { "created_at_as_date": { $gt : ISODate('2016-09-02'), $lt : ISODate("2016-09-03") } } ).count() 0
  39. > db.tweets.count() 1000 > db.tweets.find({ lang : "pt" }).count() 544

    > db.tweets.find({ created_at_as_date : { $gt : ISODate("2016-04-17") } }).count() 917 > db.tweets.find().count() 1000
  40. > db.tweets.findOne() { "_id" : ObjectId("582ce5a9a6e51390b3d62947"), "created_at" : "Thu Sep

    01 15:17:16 +0000 2016", "id" : NumberLong("771366319874859008"), "id_str" : "771366319874859008", "text" : "RT @CFKArgentina: Se consumó en Brasil el golpe institucional: Nueva forma de violentar la "source" : "<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>" "truncated" : false, "in_reply_to_status_id" : null, "in_reply_to_status_id_str" : null, "in_reply_to_user_id" : null, "in_reply_to_user_id_str" : null, "in_reply_to_screen_name" : null, "user" : { "id" : 147225872, "id_str" : "147225872", "name" : "Luis Edelman", "screen_name" : "Luis_Edelman", "location" : "Rosario ", "url" : null, "description" : "Rosarino por adopción. Latinoamericano por convicción. Taragüi", "protected" : false, "verified" : false, "followers_count" : 1126, "friends_count" : 1576, "listed_count" : 22, "favourites_count" : 3095, "statuses_count" : 17494, "created_at" : "Sun May 23 15:01:05 +0000 2010", "utc_offset" : -10800, "time_zone" : "Buenos Aires", "geo_enabled" : true, "lang" : "es", "contributors_enabled" : false, "is_translator" : false, "profile_background_color" : "B2DFDA", "profile_background_image_url" : "http://pbs.twimg.com/profile_background_images/833079358/de32f "profile_background_image_url_https" : "https://pbs.twimg.com/profile_background_images/83307935 "profile_background_tile" : false, "profile_link_color" : "93A644",
  41. > db.tweets.findOne() { "_id" : ObjectId("582ce5a9a6e51390b3d62947"), "created_at" : "Thu Sep

    01 15:17:16 +0000 2016", "id" : NumberLong("771366319874859008"), "id_str" : "771366319874859008", "text" : "RT @CFKArgentina: Se consumó en Brasil el "source" : "<a href=\"http://twitter.com/download/an (…) "favorited" : false, "retweeted" : false, "filter_level" : "low", "lang" : "es", "timestamp_ms" : "1472743036608", "created_at_as_date" : ISODate("2016-09-01T15:17:16Z }
  42. LAB Quantos usuários únicos foram coletados? Quantos dias únicos foram

    coletados? Quantos meses únicos foram coletados? Quantas hashtags únicas foram coletadas?
  43. Name Description $collStats Returns statistics regarding a collection or view.

    $project Reshapes each document in the stream, such as by adding new fields or removing existing fields. For each input document, outputs one document. $match Filters the document stream to allow only matching documents to pass unmodified into the next pipeline stage. $match uses standard MongoDB queries. For each input $redact Reshapes each document in the stream by restricting the content for each document based on information stored in the documents themselves. Incorporates the $limit Passes the first n documents unmodified to the pipeline where n is the specified limit. For each input document, outputs either one document (for the first n documents) or $skip Skips the first n documents where n is the specified skip number and passes the remaining documents unmodified to the pipeline. For each input document, outputs $unwind Deconstructs an array field from the input documents to output a document for each element. Each output document replaces the array with an element value. For each $group Groups input documents by a specified identifier expression and applies the accumulator expression(s), if specified, to each group. Consumes all input documents $sample Randomly selects the specified number of documents from its input. $sort Reorders the document stream by a specified sort key. Only the order changes; the documents remain unmodified. For each input document, outputs one document. $geoNear Returns an ordered stream of documents based on the proximity to a geospatial point. Incorporates the functionality of $match, $sort, and $limit for geospatial data. The $lookup Performs a left outer join to another collection in the same database to filter in documents from the “joined” collection for processing. $out Writes the resulting documents of the aggregation pipeline to a collection. To use the $out stage, it must be the last stage in the pipeline. $indexStats Returns statistics regarding the use of each index for the collection. $facet Processes multiple aggregation pipelines within a single stage on the same set of input documents. Enables the creation of multi-faceted aggregations capable of $bucket Categorizes incoming documents into groups, called buckets, based on a specified expression and bucket boundaries. $bucketAuto Categorizes incoming documents into a specific number of groups, called buckets, based on a specified expression. Bucket boundaries are automatically determined in $sortByCount Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group. $addFields Adds new fields to documents. Outputs documents that contain all existing fields from the input documents and newly added fields. $replaceRoot Replaces a document with the specified embedded document. The operation replaces all existing fields in the input document, including the _id field. Specify a document $count Returns a count of the number of documents at this stage of the aggregation pipeline. $graphLookup Performs a recursive search on a collection. To each output document, adds a new array field that contains the traversal results of the recursive search for that document. https://docs.mongodb.com/manual/reference/operator/aggregation/#aggregation-pipeline-operator-reference
  44. > db.tweets.aggregate([{ $match : {lang:"pt"} }]) { "_id" : ObjectId("582cec19a6e51390b3d8a0b8"),

    "created 2016", "id" : NumberLong("721191454689861632"), "id_str" "RT @ricardope: \"A palavra GOLPE estará para sempre gra democracia\" (Dilma Rousseff) #GolpeAquiNãoPassa", "sour twitter.com/download/android\" rel=\"nofollow\">Twitter false, "in_reply_to_status_id" : null, "in_reply_to_stat "in_reply_to_user_id" : null, "in_reply_to_user_id_str" : null, "user" : { "id" : NumberLong("4840659580"), "id_ "mai dom", "screen_name" : "maibdom", "location" : null, null, "protected" : false, "verified" : false, "follower 553, "listed_count" : 4, "favourites_count" : 12594, "st "created_at" : "Sun Jan 24 02:47:54 +0000 2016", "utc_of "geo_enabled" : false, "lang" : "pt", "contributors_enab false, "profile_background_color" : "F5F8FA", "profile_b "profile_background_image_url_https" : "", "profile_back "profile_link_color" : "2B7BB9", "profile_sidebar_border "profile_sidebar_fill_color" : "DDEEF6", "profile_text_c "profile_use_background_image" : true, "profile_image_ur profile_images/720376496494288896/sw1oz0Zl_normal.jpg", "https://pbs.twimg.com/profile_images/720376496494288896 "profile_banner_url" : "https://pbs.twimg.com/profile_ba
  45. > db.tweets.aggregate([ { $match : {lang:"pt"} }, { $project :

    { id:1, "user.screen_name":1, lang:true} } ]) { "_id" : ObjectId("582cec19a6e51390b3d8a0b8"), "id" : NumberLong("721191454689861632"), "user" : { "screen_name" : "maibdom" }, "lang" : "pt" } { "_id" : ObjectId("582ce48da6e51390b3d0ea72"), "id" : NumberLong("771039113625669632"), "user" : { "screen_name" : "3187798" }, "lang" : "pt" } { "_id" : ObjectId("582ce4e8a6e51390b3d2dda7"), "id" : NumberLong("771078375821697024"), "user" : { "screen_name" : "thclaudino22" }, "lang" : "pt" } { "_id" : ObjectId("582ce556a6e51390b3d4840a"), "id" : NumberLong("771124984785801217"), "user" : { "screen_name" : "AdenilcR" }, "lang" : "pt" } { "_id" : ObjectId("582cec0ca6e51390b3d870c4"), "id" : NumberLong("721162717957132288"), "user" : { "screen_name" : "peumutti2305" }, "lang" : "pt" } { "_id" : ObjectId("582ced44a6e51390b3dbdec4"), "id" : NumberLong("722023350445453312"), "user" : { "screen_name" : "MOurives" }, "lang" : "pt" } { "_id" : ObjectId("582cecb1a6e51390b3dab232"), "id" : NumberLong("721727800860884992"), "user" : { "screen_name" : "tiagoamachado20" }, "lang" : "pt" } { "_id" : ObjectId("582ce400a6e51390b3ce72ed"), "id" : NumberLong("770833071348314112"), "user" : { "screen_name" : "juiceberrylove" }, "lang" : "pt" } { "_id" : ObjectId("582ce4b7a6e51390b3d1db91"), "id" : NumberLong("771057074629447681"), "user" : { "screen_name" : "Hydra2407" }, "lang" : "pt" } { "_id" : ObjectId("582ce567a6e51390b3d4dccf"), "id" : NumberLong("771162325025955840"), "user" : { "screen_name" : "oneG_G" }, "lang" : "pt" } { "_id" : ObjectId("582cec39a6e51390b3d8f834"), "id" : NumberLong("721313057599856640"), "user" : { "screen_name" : "junioalvess" }, "lang" : "pt" } { "_id" : ObjectId("582ce659a6e51390b3d75216"), "id" : NumberLong("771436184723656704"), "user" : { "screen_name" : "brunonigro" }, "lang" : "pt" } { "_id" : ObjectId("582ce483a6e51390b3d0bc1c"), "id" : NumberLong("771036595965263872"), "user" : { "screen_name" : "vitoriajamer_" }, "lang" : "pt" } { "_id" : ObjectId("582ce52da6e51390b3d3d8fd"), "id" : NumberLong("771105357859024900"), "user" : { "screen_name" : "maarinalara" }, "lang" : "pt" } { "_id" : ObjectId("582ce42fa6e51390b3cf27f3"), "id" : NumberLong("770993244951941120"), "user" : { "screen_name" : "_ladyjulia" }, "lang" : "pt" } { "_id" : ObjectId("582ce394a6e51390b3cc6032"), "id" : NumberLong("770552025511763968"), "user" : { "screen_name" : "isacnyc20" }, "lang" : "pt" } { "_id" : ObjectId("582ce442a6e51390b3cf7ec8"), "id" : NumberLong("771016840319500294"), "user" : { "screen_name" : "JoceyrR" }, "lang" : "pt" } { "_id" : ObjectId("582ce674a6e51390b3d77bfe"), "id" : NumberLong("771449000977395713"), "user" : { "screen_name" : "finderloll" }, "lang" : "pt" } { "_id" : ObjectId("582ce4aba6e51390b3d18d93"), "id" : NumberLong("771051929774526469"), "user" : { "screen_name" : "alwaysbymyidols" }, "lang" : "pt" } { "_id" : ObjectId("582ce507a6e51390b3d3467f"), "id" : NumberLong("771088730149052416"), "user" : { "screen_name" : "shitjune" }, "lang" : "pt" } Type "it" for more
  46. > db.tweets.aggregate([ { $match : {lang:"pt"} }, { $project :

    { id:1, "user.screen_name":1, lang:1, _id:0} } ]) { "id" : NumberLong("721191454689861632"), "user" : { "screen_name" : "maibdom" }, "lang" : "pt" } { "id" : NumberLong("771039113625669632"), "user" : { "screen_name" : "3187798" }, "lang" : "pt" } { "id" : NumberLong("771078375821697024"), "user" : { "screen_name" : "thclaudino22" }, "lang" : "pt" } { "id" : NumberLong("771124984785801217"), "user" : { "screen_name" : "AdenilcR" }, "lang" : "pt" } { "id" : NumberLong("721162717957132288"), "user" : { "screen_name" : "peumutti2305" }, "lang" : "pt" } { "id" : NumberLong("722023350445453312"), "user" : { "screen_name" : "MOurives" }, "lang" : "pt" } { "id" : NumberLong("721727800860884992"), "user" : { "screen_name" : "tiagoamachado20" }, "lang" : "pt" { "id" : NumberLong("770833071348314112"), "user" : { "screen_name" : "juiceberrylove" }, "lang" : "pt" } { "id" : NumberLong("771057074629447681"), "user" : { "screen_name" : "Hydra2407" }, "lang" : "pt" } { "id" : NumberLong("771162325025955840"), "user" : { "screen_name" : "oneG_G" }, "lang" : "pt" } { "id" : NumberLong("721313057599856640"), "user" : { "screen_name" : "junioalvess" }, "lang" : "pt" } { "id" : NumberLong("771436184723656704"), "user" : { "screen_name" : "brunonigro" }, "lang" : "pt" } { "id" : NumberLong("771036595965263872"), "user" : { "screen_name" : "vitoriajamer_" }, "lang" : "pt" } { "id" : NumberLong("771105357859024900"), "user" : { "screen_name" : "maarinalara" }, "lang" : "pt" } { "id" : NumberLong("770993244951941120"), "user" : { "screen_name" : "_ladyjulia" }, "lang" : "pt" } { "id" : NumberLong("770552025511763968"), "user" : { "screen_name" : "isacnyc20" }, "lang" : "pt" } { "id" : NumberLong("771016840319500294"), "user" : { "screen_name" : "JoceyrR" }, "lang" : "pt" } { "id" : NumberLong("771449000977395713"), "user" : { "screen_name" : "finderloll" }, "lang" : "pt" } { "id" : NumberLong("771051929774526469"), "user" : { "screen_name" : "alwaysbymyidols" }, "lang" : "pt" { "id" : NumberLong("771088730149052416"), "user" : { "screen_name" : "shitjune" }, "lang" : "pt" } Type "it" for more
  47. > db.tweets.aggregate([ { $match : {lang:"pt"} }, { $project :

    { id:1, "user.screen_name":1, lang:1,_id:0} }, { $sort : {"user.screen_name":1} } ]) { "id" : NumberLong("771085171160416256"), "user" : { "screen_name" : "1cudepessoa" }, "lang" : "pt" } { "id" : NumberLong("721146892294479873"), "user" : { "screen_name" : "30o_0" }, "lang" : "pt" } { "id" : NumberLong("771039113625669632"), "user" : { "screen_name" : "3187798" }, "lang" : "pt" } { "id" : NumberLong("722204267122139138"), "user" : { "screen_name" : "AIolanda1924" }, "lang" : "pt" } { "id" : NumberLong("770630539686645760"), "user" : { "screen_name" : "AKromanov" }, "lang" : "pt" } { "id" : NumberLong("771478891567480832"), "user" : { "screen_name" : "APSempre1" }, "lang" : "pt" } { "id" : NumberLong("771112093936484352"), "user" : { "screen_name" : "AdeliaBeling" }, "lang" : "pt" } { "id" : NumberLong("771124984785801217"), "user" : { "screen_name" : "AdenilcR" }, "lang" : "pt" } { "id" : NumberLong("721795878017740802"), "user" : { "screen_name" : "AdrianaDriRio" }, "lang" : "pt" } { "id" : NumberLong("722191714820235264"), "user" : { "screen_name" : "AdrianaGPaz1" }, "lang" : "pt" } { "id" : NumberLong("771344818698088449"), "user" : { "screen_name" : "AdrienJackson" }, "lang" : "pt" } { "id" : NumberLong("722085049299021824"), "user" : { "screen_name" : "Afnso01" }, "lang" : "pt" } { "id" : NumberLong("770759873650884608"), "user" : { "screen_name" : "AlexLimaReal" }, "lang" : "pt" } { "id" : NumberLong("721582840434044928"), "user" : { "screen_name" : "AlfredoHermas" }, "lang" : "pt" } { "id" : NumberLong("770670978024210432"), "user" : { "screen_name" : "AlmeidaAlzira" }, "lang" : "pt" } { "id" : NumberLong("770644432169340928"), "user" : { "screen_name" : "AlmirBezerra3" }, "lang" : "pt" } { "id" : NumberLong("770663105693179904"), "user" : { "screen_name" : "AlmirBezerra3" }, "lang" : "pt" } { "id" : NumberLong("771027676719149056"), "user" : { "screen_name" : "AmandaBastide" }, "lang" : "pt" } { "id" : NumberLong("721673725070991360"), "user" : { "screen_name" : "Andrezaba70" }, "lang" : "pt" } { "id" : NumberLong("771057886260781057"), "user" : { "screen_name" : "Aspasiasoares" }, "lang" : "pt" } Type "it" for more
  48. > db.tweets.aggregate([ { $match : {lang:"pt"} }, { $project :

    { id:1, "user.screen_name":1, lang:1,_id:0} }, { $sort : {"user.screen_name":1} }, { $match:{“user.screen_name":"AlmirBezerra3"}} ]) { "id" : NumberLong("770644432169340928"), "user" : { "screen_name" : "AlmirBezerra3" }, "lang" : "pt" } { "id" : NumberLong("770663105693179904"), "user" : { "screen_name" : "AlmirBezerra3" }, "lang" : "pt" } > db.tweets.aggregate([ { $match : {lang:"pt"} }, { $project : { id:1, "user.screen_name":1, lang:1,_id:0} }, { $sort : {"user.screen_name":1} }, { $match:{"user.screen_name":"AlmirBezerra3"} }, { $group: { _id : { "screen_name" : "$user.screen_name" }, total : { $sum : 1} } } ]) { "_id" : { "screen_name" : "AlmirBezerra3" }, "total" : 2 }
  49. { id: 11 … lang: pt } { id: 14

    … lang: fr } { id: 25 … lang: pt } { id: 33 … lang: de } { id: 117 … lang: pt } { _id: 1 id: 11 user: lu lang: pt … } { _id: 2 id: 25 user: lu lang: pt … } { _id: 3 id: 117 user: bia lang: pt … } { id: 11 user: lu lang: pt } { id: 25 user: lu lang: pt } { id: 117 user: bia lang: pt } { id: 11 user: lu lang: pt } { id: 25 user: lu lang: pt } { id: 117 user: bia lang: pt } { id: 11 user: lu lang: pt } { id: 25 user: lu lang: pt } { "_id" : { "user":"lu" }, "total" : 2 } > db.tweets.aggregate([ ]) { $match : {lang:"pt"} }, { $project : { id:1, "user.screen_name":1, lang:1,_id:0} }, { $sort : {"user.screen_name":1} }, { $match:{"user.screen_name":"lu"} }, { $group: { } _id : { "screen_name" : "$user.screen_name" }, total : { $sum : 1 }
  50. { … lang: pt … } { … lang: es

    … } { … lang: fr … } { … lang: pt … } { … lang: de … } { … lang: fr … } { _id: { lang: pt } total: 2 } { _id: { lang: es } total: 1 } { _id: { lang: fr } total: 2 } { _id: { lang: de } total: 1 } { _id: { lang: de } total: 1 } { _id: { lang: es } total: 1 } { _id: { lang: fr } total: 2 } { _id: { lang: pt } total: 2 } { lang: de total: 1 } { lang: es total: 1 } { lang: fr total: 2 } { lang: pt total: 2 } group sort project
  51. > db.tweets.distinct("lang").length 8 > db.tweets.distinct("lang") [ "es", "pt", "und", "tr",

    "en", "in", "fr", "lt" ] > db.tweets.aggregate([ { $group : { _id : { lang : “$lang” }, total : { $sum : 1}} } ]) { "_id" : { "lang" : "in" }, "total" : 1 } { "_id" : { "lang" : "tr" }, "total" : 1 } { "_id" : { "lang" : "und" }, "total" : 6 } { "_id" : { "lang" : "en" }, "total" : 5 } { "_id" : { "lang" : "pt" }, "total" : 544 } { "_id" : { "lang" : "lt" }, "total" : 1 } { "_id" : { "lang" : "fr" }, "total" : 2 } { "_id" : { "lang" : "es" }, "total" : 440 }
  52. > db.tweets.aggregate([ { $group : { _id : { lang

    : “$lang” }, total : { $sum : 1}} }, { $sort: { “_id.lang":1} } ]) { "_id" : { "lang" : "en" }, "total" : 5 } { "_id" : { "lang" : "es" }, "total" : 440 } { "_id" : { "lang" : "fr" }, "total" : 2 } { "_id" : { "lang" : "in" }, "total" : 1 } { "_id" : { "lang" : "lt" }, "total" : 1 } { "_id" : { "lang" : "pt" }, "total" : 544 } { "_id" : { "lang" : "tr" }, "total" : 1 } { "_id" : { "lang" : "und" }, "total" : 6 } > db.tweets.aggregate([ { $group : { _id : { lang : “$lang” }, total : { $sum : 1}} } ]) { "_id" : { "lang" : "in" }, "total" : 1 } { "_id" : { "lang" : "tr" }, "total" : 1 } { "_id" : { "lang" : "und" }, "total" : 6 } { "_id" : { "lang" : "en" }, "total" : 5 } { "_id" : { "lang" : "pt" }, "total" : 544 } { "_id" : { "lang" : "lt" }, "total" : 1 } { "_id" : { "lang" : "fr" }, "total" : 2 } { "_id" : { "lang" : "es" }, "total" : 440 }
  53. > db.tweets.aggregate([ { $group : { _id : { lang

    : “$lang” }, total : { $sum : 1}} }, { $sort : { “_id.lang":1} }, { $project : { _id : 0 , “lang" : “$_id.lang", “total" : “$total" } } ]) { "total" : 5, "lang" : "en" } { "total" : 440, "lang" : "es" } { "total" : 2, "lang" : "fr" } { "total" : 1, "lang" : "in" } { "total" : 1, "lang" : "lt" } { "total" : 544, "lang" : "pt" } { "total" : 1, "lang" : "tr" } { "total" : 6, "lang" : "und" } > db.tweets.aggregate([ { $group : { _id : { lang : “$lang” }, total : { $sum : 1}} }, { $sort: { “_id.lang":1} } ]) { "_id" : { "lang" : "en" }, "total" : 5 } { "_id" : { "lang" : "es" }, "total" : 440 } { "_id" : { "lang" : "fr" }, "total" : 2 } { "_id" : { "lang" : "in" }, "total" : 1 } { "_id" : { "lang" : "lt" }, "total" : 1 } { "_id" : { "lang" : "pt" }, "total" : 544 } { "_id" : { "lang" : "tr" }, "total" : 1 } { "_id" : { "lang" : "und" }, "total" : 6 }
  54. > db.tweets.distinct("created_at").length 997 > db.tweets.distinct("created_at_as_date").length 997 > db.tweets.aggregate([ { $project

    : { _id : 0, data : ”$created_at_as_date”} } ]) { "data" : ISODate("2016-09-01T15:17:16Z") } { "data" : ISODate("2016-04-18T18:53:27Z") } { "data" : ISODate("2016-04-16T04:20:16Z") } { "data" : ISODate("2016-08-31T17:37:04Z") } { "data" : ISODate("2016-08-31T20:13:05Z") } { "data" : ISODate("2016-09-01T04:24:28Z") } { "data" : ISODate("2016-08-31T23:18:17Z") } { "data" : ISODate("2016-04-17T00:24:24Z") } { "data" : ISODate("2016-09-01T22:42:24Z") } { "data" : ISODate("2016-04-16T02:26:05Z") } { "data" : ISODate("2016-04-18T11:25:55Z") } { "data" : ISODate("2016-04-17T15:51:31Z") } { "data" : ISODate("2016-09-01T19:46:37Z") } { "data" : ISODate("2016-08-31T03:58:20Z") } { "data" : ISODate("2016-08-31T18:48:26Z") } { "data" : ISODate("2016-08-31T19:45:21Z") } { "data" : ISODate("2016-09-01T01:46:40Z") } { "data" : ISODate("2016-09-01T14:28:29Z") } { "data" : ISODate("2016-09-01T16:08:39Z") } { "data" : ISODate("2016-04-16T12:23:28Z") } Type "it" for more
  55. > db.tweets.aggregate([ { $project:{ _id:0, data:”$created_at_as_date", ano:{$year:”$created_at_as_date”}} } ]) {

    "data" : ISODate("2016-09-01T15:17:16Z"), "ano" : 2016 } { "data" : ISODate("2016-04-18T18:53:27Z"), "ano" : 2016 } { "data" : ISODate("2016-04-16T04:20:16Z"), "ano" : 2016 } { "data" : ISODate("2016-08-31T17:37:04Z"), "ano" : 2016 } { "data" : ISODate("2016-08-31T20:13:05Z"), "ano" : 2016 } { "data" : ISODate("2016-09-01T04:24:28Z"), "ano" : 2016 } { "data" : ISODate("2016-08-31T23:18:17Z"), "ano" : 2016 } { "data" : ISODate("2016-04-17T00:24:24Z"), "ano" : 2016 } { "data" : ISODate("2016-09-01T22:42:24Z"), "ano" : 2016 } { "data" : ISODate("2016-04-16T02:26:05Z"), "ano" : 2016 } { "data" : ISODate("2016-04-18T11:25:55Z"), "ano" : 2016 } { "data" : ISODate("2016-04-17T15:51:31Z"), "ano" : 2016 } { "data" : ISODate("2016-09-01T19:46:37Z"), "ano" : 2016 } { "data" : ISODate("2016-08-31T03:58:20Z"), "ano" : 2016 } { "data" : ISODate("2016-08-31T18:48:26Z"), "ano" : 2016 } { "data" : ISODate("2016-08-31T19:45:21Z"), "ano" : 2016 } { "data" : ISODate("2016-09-01T01:46:40Z"), "ano" : 2016 } { "data" : ISODate("2016-09-01T14:28:29Z"), "ano" : 2016 } { "data" : ISODate("2016-09-01T16:08:39Z"), "ano" : 2016 } { "data" : ISODate("2016-04-16T12:23:28Z"), "ano" : 2016 } Type "it" for more https://docs.mongodb.com/manual/reference/operator/aggregation/#date-operators
  56. > db.tweets.aggregate([ { $project:{ _id:0, data:”$created_at_as_date", ano:{$year:”$created_at_as_date”}, mes:{$month:"$created_at_as_date"}} } ])

    { "data" : ISODate("2016-09-01T15:17:16Z"), "ano" : 2016, "mes" : 9 } { "data" : ISODate("2016-04-18T18:53:27Z"), "ano" : 2016, "mes" : 4 } { "data" : ISODate("2016-04-16T04:20:16Z"), "ano" : 2016, "mes" : 4 } { "data" : ISODate("2016-08-31T17:37:04Z"), "ano" : 2016, "mes" : 8 } { "data" : ISODate("2016-08-31T20:13:05Z"), "ano" : 2016, "mes" : 8 } { "data" : ISODate("2016-09-01T04:24:28Z"), "ano" : 2016, "mes" : 9 } { "data" : ISODate("2016-08-31T23:18:17Z"), "ano" : 2016, "mes" : 8 } { "data" : ISODate("2016-04-17T00:24:24Z"), "ano" : 2016, "mes" : 4 } { "data" : ISODate("2016-09-01T22:42:24Z"), "ano" : 2016, "mes" : 9 } { "data" : ISODate("2016-04-16T02:26:05Z"), "ano" : 2016, "mes" : 4 } { "data" : ISODate("2016-04-18T11:25:55Z"), "ano" : 2016, "mes" : 4 } { "data" : ISODate("2016-04-17T15:51:31Z"), "ano" : 2016, "mes" : 4 } { "data" : ISODate("2016-09-01T19:46:37Z"), "ano" : 2016, "mes" : 9 } { "data" : ISODate("2016-08-31T03:58:20Z"), "ano" : 2016, "mes" : 8 } { "data" : ISODate("2016-08-31T18:48:26Z"), "ano" : 2016, "mes" : 8 } { "data" : ISODate("2016-08-31T19:45:21Z"), "ano" : 2016, "mes" : 8 } { "data" : ISODate("2016-09-01T01:46:40Z"), "ano" : 2016, "mes" : 9 } { "data" : ISODate("2016-09-01T14:28:29Z"), "ano" : 2016, "mes" : 9 } { "data" : ISODate("2016-09-01T16:08:39Z"), "ano" : 2016, "mes" : 9 } { "data" : ISODate("2016-04-16T12:23:28Z"), "ano" : 2016, "mes" : 4 } Type "it" for more
  57. > db.tweets.aggregate([ { $project:{ _id:0, data:”$created_at_as_date", ano:{$year:”$created_at_as_date”}, mes:{$month:”$created_at_as_date”}, dia:{$dayOfMonth:"$created_at_as_date"}} }

    ]) { "data" : ISODate("2016-09-01T15:17:16Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-18T18:53:27Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-16T04:20:16Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-08-31T17:37:04Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T20:13:05Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T04:24:28Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T23:18:17Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-04-17T00:24:24Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T22:42:24Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T02:26:05Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-04-18T11:25:55Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-17T15:51:31Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T19:46:37Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T03:58:20Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T18:48:26Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T19:45:21Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T01:46:40Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T14:28:29Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T16:08:39Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T12:23:28Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } Type "it" for more
  58. > db.tweets.aggregate([ { $project:{ _id:0, data:”$created_at_as_date", ano:{$year:”$created_at_as_date”}, mes:{$month:”$created_at_as_date”}, dia:{$dayOfMonth:"$created_at_as_date"}} },

    { $group: { _id : 0, distinctDate : { $addToSet : { y :"$ano", m :"$mes", d :"$dia" } } } } ]) https://docs.mongodb.com/manual/reference/operator/aggregation/#accumulators
  59. { "data" : ISODate("2016-09-01T15:17:16Z"), "ano" : 2016, "mes" : 9,

    "dia" : 1 } { "data" : ISODate("2016-04-18T18:53:27Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-16T04:20:16Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-08-31T17:37:04Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T20:13:05Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T04:24:28Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T23:18:17Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-04-17T00:24:24Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T22:42:24Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T02:26:05Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-04-18T11:25:55Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-17T15:51:31Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T19:46:37Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T03:58:20Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T18:48:26Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T19:45:21Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T01:46:40Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T14:28:29Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T16:08:39Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T12:23:28Z"), "ano" : 2016, "mes" : 4, "dia" : 16 }
  60. { "data" : ISODate("2016-09-01T15:17:16Z"), "ano" : 2016, "mes" : 9,

    "dia" : 1 } { "data" : ISODate("2016-04-18T18:53:27Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-16T04:20:16Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-08-31T17:37:04Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T20:13:05Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T04:24:28Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T23:18:17Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-04-17T00:24:24Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T22:42:24Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T02:26:05Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-04-18T11:25:55Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-17T15:51:31Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T19:46:37Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T03:58:20Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T18:48:26Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T19:45:21Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T01:46:40Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T14:28:29Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T16:08:39Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T12:23:28Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "distinctDate" : [ ] }
  61. { "data" : ISODate("2016-09-01T15:17:16Z"), "ano" : 2016, "mes" : 9,

    "dia" : 1 } { "data" : ISODate("2016-04-18T18:53:27Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-16T04:20:16Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-08-31T17:37:04Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T20:13:05Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T04:24:28Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T23:18:17Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-04-17T00:24:24Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T22:42:24Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T02:26:05Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-04-18T11:25:55Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-17T15:51:31Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T19:46:37Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T03:58:20Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T18:48:26Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T19:45:21Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T01:46:40Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T14:28:29Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T16:08:39Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T12:23:28Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "distinctDate" : [ ] } { "y" : 2016, "m" : 9, "d" : 1 },
  62. { "data" : ISODate("2016-09-01T15:17:16Z"), "ano" : 2016, "mes" : 9,

    "dia" : 1 } { "data" : ISODate("2016-04-18T18:53:27Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-16T04:20:16Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-08-31T17:37:04Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T20:13:05Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T04:24:28Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T23:18:17Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-04-17T00:24:24Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T22:42:24Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T02:26:05Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-04-18T11:25:55Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-17T15:51:31Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T19:46:37Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T03:58:20Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T18:48:26Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T19:45:21Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T01:46:40Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T14:28:29Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T16:08:39Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T12:23:28Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "distinctDate" : [ ] } { "y" : 2016, "m" : 9, "d" : 1 }, { "y" : 2016, "m" : 4, "d" : 18 },
  63. { "data" : ISODate("2016-09-01T15:17:16Z"), "ano" : 2016, "mes" : 9,

    "dia" : 1 } { "data" : ISODate("2016-04-18T18:53:27Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-16T04:20:16Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-08-31T17:37:04Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T20:13:05Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T04:24:28Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T23:18:17Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-04-17T00:24:24Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T22:42:24Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T02:26:05Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-04-18T11:25:55Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-17T15:51:31Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T19:46:37Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T03:58:20Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T18:48:26Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T19:45:21Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T01:46:40Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T14:28:29Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T16:08:39Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T12:23:28Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "distinctDate" : [ ] } { "y" : 2016, "m" : 9, "d" : 1 }, { "y" : 2016, "m" : 4, "d" : 18 }, { "y" : 2016, "m" : 4, "d" : 16 },
  64. { "data" : ISODate("2016-09-01T15:17:16Z"), "ano" : 2016, "mes" : 9,

    "dia" : 1 } { "data" : ISODate("2016-04-18T18:53:27Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-16T04:20:16Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-08-31T17:37:04Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T20:13:05Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T04:24:28Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T23:18:17Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-04-17T00:24:24Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T22:42:24Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T02:26:05Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-04-18T11:25:55Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-17T15:51:31Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T19:46:37Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T03:58:20Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T18:48:26Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T19:45:21Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T01:46:40Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T14:28:29Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T16:08:39Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T12:23:28Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "distinctDate" : [ ] } { "y" : 2016, "m" : 9, "d" : 1 }, { "y" : 2016, "m" : 4, "d" : 18 }, { "y" : 2016, "m" : 4, "d" : 16 }, { "y" : 2016, "m" : 8, "d" : 31 },
  65. { "data" : ISODate("2016-09-01T15:17:16Z"), "ano" : 2016, "mes" : 9,

    "dia" : 1 } { "data" : ISODate("2016-04-18T18:53:27Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-16T04:20:16Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-08-31T17:37:04Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T20:13:05Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T04:24:28Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T23:18:17Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-04-17T00:24:24Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T22:42:24Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T02:26:05Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-04-18T11:25:55Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-17T15:51:31Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T19:46:37Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T03:58:20Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T18:48:26Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T19:45:21Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T01:46:40Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T14:28:29Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T16:08:39Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T12:23:28Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "distinctDate" : [ ] } { "y" : 2016, "m" : 9, "d" : 1 }, { "y" : 2016, "m" : 4, "d" : 18 }, { "y" : 2016, "m" : 4, "d" : 16 }, { "y" : 2016, "m" : 8, "d" : 31 }, { "y" : 2016, "m" : 8, "d" : 31 },
  66. { "y" : 2016, "m" : 9, "d" : 1

    }, { "data" : ISODate("2016-09-01T15:17:16Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-18T18:53:27Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-16T04:20:16Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-08-31T17:37:04Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T20:13:05Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T04:24:28Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T23:18:17Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-04-17T00:24:24Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T22:42:24Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T02:26:05Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-04-18T11:25:55Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-17T15:51:31Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T19:46:37Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T03:58:20Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T18:48:26Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T19:45:21Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T01:46:40Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T14:28:29Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T16:08:39Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T12:23:28Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "distinctDate" : [ ] } { "y" : 2016, "m" : 9, "d" : 1 }, { "y" : 2016, "m" : 4, "d" : 18 }, { "y" : 2016, "m" : 4, "d" : 16 }, { "y" : 2016, "m" : 8, "d" : 31 },
  67. { "y" : 2016, "m" : 9, "d" : 1

    }, { "data" : ISODate("2016-09-01T15:17:16Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-18T18:53:27Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-16T04:20:16Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-08-31T17:37:04Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T20:13:05Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T04:24:28Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T23:18:17Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-04-17T00:24:24Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T22:42:24Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T02:26:05Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "data" : ISODate("2016-04-18T11:25:55Z"), "ano" : 2016, "mes" : 4, "dia" : 18 } { "data" : ISODate("2016-04-17T15:51:31Z"), "ano" : 2016, "mes" : 4, "dia" : 17 } { "data" : ISODate("2016-09-01T19:46:37Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-08-31T03:58:20Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T18:48:26Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-08-31T19:45:21Z"), "ano" : 2016, "mes" : 8, "dia" : 31 } { "data" : ISODate("2016-09-01T01:46:40Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T14:28:29Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-09-01T16:08:39Z"), "ano" : 2016, "mes" : 9, "dia" : 1 } { "data" : ISODate("2016-04-16T12:23:28Z"), "ano" : 2016, "mes" : 4, "dia" : 16 } { "distinctDate" : [ ] } { "y" : 2016, "m" : 9, "d" : 1 }, { "y" : 2016, "m" : 4, "d" : 18 }, { "y" : 2016, "m" : 4, "d" : 16 }, { "y" : 2016, "m" : 8, "d" : 31 }, …
  68. { "distinctDate" : [ { "y" : 2016, "m" :

    8, "d" : 30 }, { "y" : 2016, "m" : 8, "d" : 31 }, { "y" : 2016, "m" : 4, "d" : 16 }, { "y" : 2016, "m" : 4, "d" : 18 }, { "y" : 2016, "m" : 4, "d" : 17 }, { "y" : 2016, "m" : 9, "d" : 1 } ] }
  69. LAB Quais as hashtags únicas coletadas? Quantos usuários únicos tuitaram?

    Quantos tweets únicos foram retuitados? Quantos usuários únicos foram retuitados?
  70. > db.tweets.aggregate([ { $project: { year : { "$year": "$created_at_as_date"},

    month : { "$month" : "$created_at_as_date" }, day : { "$dayOfMonth" : "$created_at_as_date" } } } ]) { "_id" : ObjectId("582ce5a9a6e51390b3d62947"), "year" : 2016, "month" : 9, "day" : 1 } { "_id" : ObjectId("582cedb6a6e51390b3dce2c0"), "year" : 2016, "month" : 4, "day" : 18 } { "_id" : ObjectId("582cec19a6e51390b3d8a0b8"), "year" : 2016, "month" : 4, "day" : 16 } { "_id" : ObjectId("582ce48da6e51390b3d0ea72"), "year" : 2016, "month" : 8, "day" : 31 } { "_id" : ObjectId("582ce4e8a6e51390b3d2dda7"), "year" : 2016, "month" : 8, "day" : 31 } { "_id" : ObjectId("582ce575a6e51390b3d51356"), "year" : 2016, "month" : 9, "day" : 1 } { "_id" : ObjectId("582ce556a6e51390b3d4840a"), "year" : 2016, "month" : 8, "day" : 31 } { "_id" : ObjectId("582cec69a6e51390b3d9aa9c"), "year" : 2016, "month" : 4, "day" : 17 } { "_id" : ObjectId("582ce6bda6e51390b3d7e27f"), "year" : 2016, "month" : 9, "day" : 1 } { "_id" : ObjectId("582cec0ca6e51390b3d870c4"), "year" : 2016, "month" : 4, "day" : 16 } { "_id" : ObjectId("582ced44a6e51390b3dbdec4"), "year" : 2016, "month" : 4, "day" : 18 } { "_id" : ObjectId("582cecb1a6e51390b3dab232"), "year" : 2016, "month" : 4, "day" : 17 } { "_id" : ObjectId("582ce658a6e51390b3d74b09"), "year" : 2016, "month" : 9, "day" : 1 } { "_id" : ObjectId("582ce400a6e51390b3ce72ed"), "year" : 2016, "month" : 8, "day" : 31 } { "_id" : ObjectId("582ce4b7a6e51390b3d1db91"), "year" : 2016, "month" : 8, "day" : 31 } { "_id" : ObjectId("582ce4d8a6e51390b3d28b81"), "year" : 2016, "month" : 8, "day" : 31 } { "_id" : ObjectId("582ce567a6e51390b3d4dccf"), "year" : 2016, "month" : 9, "day" : 1 } { "_id" : ObjectId("582ce5a1a6e51390b3d5fc85"), "year" : 2016, "month" : 9, "day" : 1 } { "_id" : ObjectId("582ce5baa6e51390b3d669a2"), "year" : 2016, "month" : 9, "day" : 1 } { "_id" : ObjectId("582cec39a6e51390b3d8f834"), "year" : 2016, "month" : 4, "day" : 16 }
  71. > db.tweets.aggregate([ { $project: { year : { "$year": "$created_at_as_date"},

    month : { "$month" : "$created_at_as_date" }, day : { "$dayOfMonth" : "$created_at_as_date" }}}, { "$group": { "_id" : { “year":"$year", “month":"$month", “day":"$day"}, "total" : {$sum: 1} }} ]) { "_id" : { "year" : 2016, "month" : 4, "day" : 17 }, "total" : 76 } { "_id" : { "year" : 2016, "month" : 8, "day" : 31 }, "total" : 364 } { "_id" : { "year" : 2016, "month" : 4, "day" : 16 }, "total" : 83 } { "_id" : { "year" : 2016, "month" : 8, "day" : 30 }, "total" : 154 } { "_id" : { "year" : 2016, "month" : 4, "day" : 18 }, "total" : 133 } { "_id" : { "year" : 2016, "month" : 9, "day" : 1 }, "total" : 190 }
  72. LAB Quantos tweets por mês? Quantos tweets por ano? Qual

    a hora do dia que tem mais tweets? Qual o turno que tem mais tweets?
  73. LAB Quais foram os tweets mais tuitados? Qual a quantidade

    de retweets por mês? Quais os tweets mais retweetados, mês a mês? Quais as hashtags mais recorrentes?