(Gold)mining MongoDB collections
Using the goldmine gem and the ruby mongo driver:
require File.join(File.dirname(__FILE__), 'digger')
digger = Digger
cursor1 = digger.find_all('tamil','onovate')
list1 = digger.collect_array(cursor1,'ono_stream')
fn = list1.dig("more than 1 follower"){|i| i['user']['followers_count'] > 1}
bjw = list1.dig("bowleslingjw"){|i| i['user']['screen_name'] == 'bowleslingjw'}
arrays = list1.dig("array"){|i| i["entities"]["hashtags"].is_a?(Array)}
See the gist
Written by josh bowles
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Related Tags
#ruby
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#