Method: Mongo::DB#query
- Defined in:
- lib/mongo/db.rb
#query(collection, query, admin = false) ⇒ Object
Returns a Cursor over the query results.
Note that the query gets sent lazily; the cursor calls #send_query_message when needed. If the caller never requests an object from the cursor, the query never gets sent.
363 364 365 |
# File 'lib/mongo/db.rb', line 363 def query(collection, query, admin=false) Cursor.new(self, collection, query, admin) end |