Method: Esse::Index::ObjectDocumentMapper#documents

Defined in:
lib/esse/index/object_document_mapper.rb

#documents(repo_name = nil, **kwargs) ⇒ Enumerator

Wrap collection data into serialized documents

Example:

GeosIndex.documents(id: 1).first

Parameters:

  • repo_name (String, NilClass) (defaults to: nil)

    The repository identifier

Returns:

  • (Enumerator)

    All serialized entries



25
26
27
28
29
30
31
# File 'lib/esse/index/object_document_mapper.rb', line 25

def documents(repo_name = nil, **kwargs)
  Enumerator.new do |yielder|
    each_serialized_batch(repo_name, **kwargs) do |documents, **_collection_kargs|
      documents.each { |document| yielder.yield(document) }
    end
  end
end