Q: How to pass the second parameter to Mongo::Collection#find? This is a newbie question. I find the method definition in the YARD Rdoc:
(Object) find(selector = {}, opts = {})


Options Hash (opts):
:fields (Array, Hash) 

then I try this coll.find('English' => 'fulcrum',{English:1,Chinese:1}), want the result 'English' field is fulcrum ,and only return English and Chinese field, but Ruby punished me with the this
irb(main):018:0> coll.find('English' => 'fulcrum',{English:1,Chinese:1})
SyntaxError: (irb):18: syntax error, unexpected ')', expecting tASSOC
    from /usr/local/bin/irb:12:in `<main>'
irb(main):019:0> 

I want to know why, thanks
after correct the syntax problem by the suggestion by @mu, I got Unknown options error:
irb(main):013:0> coll.find({English:'fulcrum'},{English:1, :Chinese => 1})RuntimeError: Unknown options [{:English=>1, :Chinese=>1}]
    from /usr/local/lib/ruby/gems/1.9.1/gems/mongo-1.5.2/lib/mongo/collection.rb:234:in `find'
    from (irb):13
    from /usr/local/bin/irb:12:in `<main>'
irb(main):014:0> 


A: When Ruby sees an unwrapped Hash in argument list:
o.m(k => v, ...)

it assumes that you really mean this:
o.m({ k => v, ... })

So, when you say this:
coll.find('English' => 'fulcrum', {English: 1, Chinese: 1})

Ruby sees this:
coll.find({ 'English' => 'fulcrum', {English: 1, Chinese: 1} })

A Hash is a perfectly valid key so Ruby expects it to be followed by a => value:
coll.find('English' => 'fulcrum', {English: 1, Chinese: 1} => some_value)

and that's where the error message comes from:
syntax error, unexpected ')', expecting tASSOC

If you want to pass two hashes, you need to wrap the first one in braces:
coll.find({'English' => 'fulcrum'}, {English: 1, Chinese: 1})


The second argument to [find](
http://api.mongodb.org/ruby/current/Mongo/Collection.html#find-instance_method) should be an options Hash and it looks like you want the :fields option and you can give that an array of names instead of a noisy Hash:
coll.find({'English' => 'fulcrum'}, :fields => %w[English Chinese])

