Skip to content

Instantly share code, notes, and snippets.

@joannecheng
Created August 7, 2012 06:16
Show Gist options
  • Save joannecheng/3282265 to your computer and use it in GitHub Desktop.
Save joannecheng/3282265 to your computer and use it in GitHub Desktop.
Search for nested objects using mongo-ruby
require 'rubygems'
require 'mongo'
@conn = Mongo::Connection.new
@db = @conn['trails']
@collection = @db['bikeways']
puts @collection.find('properties.FCODE' => 203001).to_a
# BOOM
#
# Goddammit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment