Class: Redis::Commands::Search::AggregateResult
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Instance Chain:
self,
Enumerable
|
|
| Inherits: | Object |
| Defined in: | lib/redis/commands/modules/search/result.rb |
Overview
Result of FT.AGGREGATE (and FT.CURSOR READ): the rows produced by the pipeline plus, when WITHCURSOR was requested, the cursor id to read the next batch with (0 when the cursor is exhausted).
Class Method Summary
- .new(rows, cursor: nil) ⇒ AggregateResult constructor
Instance Attribute Summary
- #cursor ⇒ Array<Hash{String => Object}>, ... readonly
- #empty? ⇒ Boolean readonly
- #rows ⇒ Array<Hash{String => Object}>, ... readonly
Instance Method Summary
- #[](index) ⇒ Hash?
-
#each {|row| ... } ⇒ Enumerator, Array<Hash>
Iterate over the rows.
-
#length
Alias for #size.
- #size ⇒ Integer (also: #length)
Constructor Details
.new(rows, cursor: nil) ⇒ AggregateResult
Instance Attribute Details
#cursor ⇒ Array<Hash{String => Object}>, ... (readonly)
# File 'lib/redis/commands/modules/search/result.rb', line 126
attr_reader :rows, :cursor
#empty? ⇒ Boolean (readonly)
# File 'lib/redis/commands/modules/search/result.rb', line 156
def empty? @rows.empty? end
#rows ⇒ Array<Hash{String => Object}>, ... (readonly)
# File 'lib/redis/commands/modules/search/result.rb', line 126
attr_reader :rows, :cursor
Instance Method Details
#[](index) ⇒ Hash?
# File 'lib/redis/commands/modules/search/result.rb', line 145
def [](index) @rows[index] end
#each {|row| ... } ⇒ Enumerator, Array<Hash>
Iterate over the rows.
# File 'lib/redis/commands/modules/search/result.rb', line 139
def each(&block) @rows.each(&block) end
#length
Alias for #size.
# File 'lib/redis/commands/modules/search/result.rb', line 153
alias length size
#size ⇒ Integer
Also known as: #length
# File 'lib/redis/commands/modules/search/result.rb', line 150
def size @rows.size end