Class: Mongoid::QueryCache::CachedCursor Deprecated
- Inherits:
-
Mongo::Cursor
- Object
- Mongo::Cursor
- Mongoid::QueryCache::CachedCursor
- Defined in:
- lib/mongoid/query_cache.rb
Overview
Deprecated.
This class is only used with driver versions 2.13 and lower.
A Cursor that attempts to load documents from memory first before hitting the database if the same query has already been executed.
Instance Method Summary collapse
-
#each ⇒ Object
We iterate over the cached documents if they exist already in the cursor otherwise proceed as normal.
-
#inspect ⇒ String
Get a human-readable string representation of
Cursor
.
Instance Method Details
#each ⇒ Object
We iterate over the cached documents if they exist already in the cursor otherwise proceed as normal.
171 172 173 174 175 176 177 178 179 |
# File 'lib/mongoid/query_cache.rb', line 171 def each if @cached_documents @cached_documents.each do |doc| yield doc end else super end end |
#inspect ⇒ String
Get a human-readable string representation of Cursor
.
189 190 191 |
# File 'lib/mongoid/query_cache.rb', line 189 def inspect "#<Mongoid::QueryCache::CachedCursor:0x#{object_id} @view=#{@view.inspect}>" end |