Closed libbyh closed 7 years ago
Create new mongo index for entities.user_mentions.id
It'll take a while to run, so do it in the background like so (-ish? check my syntax, but the background: true part is right)
background: true
db.collection.createIndex( { entities.user_mentions.id: 1 }, { background: true } )
Example tweet with a mention:
{ "_id" : ObjectId("588d32f121e3853e45252428"), "contributors" : null, "truncated" : false, "text" : "@RogueNASA @Signalnoise so good!!!", "hashtags" : [ ], "is_quote_status" : false, "in_reply_to_status_id" : NumberLong("825432933955674112"), "counts" : { "user_mentions" : 2, "hashtags" : 0, "coded_urls" : 0, "urls" : 0 }, "id" : NumberLong("825433399548661760"), "favorite_count" : 0, "codes" : [ ], "source" : "<a href=\"http://twitter.com/download/android\" rel=\"nofollow\">Twitter for Android</a>", "retweeted" : false, "coordinates" : null, "timestamp_ms" : "1485633632920", "entities" : { "user_mentions" : [ { "indices" : [ 0, 10 ], "id_str" : "824320219866923018", "screen_name" : "RogueNASA", "name" : "Rogue NASA", "id" : NumberLong("824320219866923018") }, { "indices" : [ 11, 23 ], "id_str" : "22792833", "screen_name" : "Signalnoise", "name" : "James White", "id" : 22792833 } ], "symbols" : [ ], "hashtags" : [ ], "urls" : [ ] }, "in_reply_to_screen_name" : "RogueNASA", "id_str" : "825433399548661760", "track_kw" : { "mentions" : [ "roguenasa" ], "hashtags" : [ ], "text" : [ "roguenasa" ] }, "display_text_range" : [ 24, 34 ], "retweet_count" : 0, "in_reply_to_user_id" : NumberLong("824320219866923018"), "favorited" : false, "user" : { "follow_request_sent" : null, "profile_use_background_image" : true, "contributors_enabled" : false, "id" : 43611829, "verified" : false, "profile_image_url_https" : "https://pbs.twimg.com/profile_images/240769565/fry_ty_normal.jpg", "profile_sidebar_fill_color" : "A0C7A4", "profile_text_color" : "333333", "followers_count" : 236, "profile_sidebar_border_color" : "86A69F", "location" : "Arkham", "default_profile_image" : false, "id_str" : "43611829", "utc_offset" : -18000, "statuses_count" : 4063, "description" : "Monster Hunter", "friends_count" : 129, "profile_link_color" : "0059FF", "profile_background_tile" : false, "profile_image_url" : "http://pbs.twimg.com/profile_images/240769565/fry_ty_normal.jpg", "notifications" : null, "geo_enabled" : false, "profile_background_color" : "709197", "profile_banner_url" : "https://pbs.twimg.com/profile_banners/43611829/1388062443", "profile_background_image_url" : "http://pbs.twimg.com/profile_background_images/35379834/ty-tweet_copy.jpg", "name" : "Ty Gowen", "lang" : "en", "following" : null, "created_ts" : ISODate("2009-05-30T23:06:39Z"), "favourites_count" : 951, "screen_name" : "Unrefined_Ty", "url" : "http://www.haunt-me.com", "created_at" : "Sat May 30 23:06:39 +0000 2009", "profile_background_image_url_https" : "https://pbs.twimg.com/profile_background_images/35379834/ty-tweet_copy.jpg", "time_zone" : "Eastern Time (US & Canada)", "protected" : false, "default_profile" : false, "is_translator" : false, "listed_count" : 10 }, "geo" : null, "in_reply_to_user_id_str" : "824320219866923018", "lang" : "en", "created_ts" : ISODate("2017-01-28T20:00:32Z"), "text_hash" : "384bf07b5fad325a31585a6cdc2d2d09", "created_at" : "Sat Jan 28 20:00:32 +0000 2017", "filter_level" : "low", "in_reply_to_status_id_str" : "825432933955674112", "place" : null, "mentions" : [ "roguenasa", "signalnoise" ] }
completed
Create new mongo index for entities.user_mentions.id
It'll take a while to run, so do it in the background like so (-ish? check my syntax, but the
background: true
part is right)db.collection.createIndex( { entities.user_mentions.id: 1 }, { background: true } )
Example tweet with a mention: