Method: MongoDoc::Collection#find

Defined in:
lib/mongodoc/collection.rb

#find(query = {}, options = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/mongodoc/collection.rb', line 13

def find(query = {}, options = {})
  cursor = wrapped_cursor(query, options)
  if block_given?
    yield cursor
    cursor.close
  else
    cursor
  end
end