Method: Moped::Cursor#load_docs

Defined in:
lib/moped/cursor.rb

#load_docsArray<Hash>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Load the documents from the database.

Examples:

Load the documents.

cursor.load_docs

Returns:

Since:

  • 1.0.0



129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'lib/moped/cursor.rb', line 129

def load_docs
  consistency = session.consistency
  @options[:flags] |= [:slave_ok] if consistency == :eventual
  @options[:flags] |= [:no_cursor_timeout] if @options[:no_timeout]

  options = @options.clone
  options[:limit] = request_limit

  reply, @node = session.context.with_node do |node|
    [ node.query(@database, @collection, @selector, options), node ]
  end

  @limit -= reply.count if limited?
  @cursor_id = reply.cursor_id
  reply.documents
end