Method: MarkLogic::Collection#find

Defined in:
lib/marklogic/collection.rb

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



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'lib/marklogic/collection.rb', line 115

def find(query = nil, options = {})
  if query.class == Hash
    query = from_criteria(query)
  elsif query.nil?
    query = Queries::AndQuery.new()
  end
  options[:query] = query
  cursor = MarkLogic::Cursor.new(self, options)

  if block_given?
    yield cursor
    nil
  else
    cursor
  end
end