Class: Couchbase::Bucket::ViewOptions
- Inherits:
-
Object
- Object
- Couchbase::Bucket::ViewOptions
- Defined in:
- lib/couchbase/view_options.rb
Instance Attribute Summary collapse
-
#debug ⇒ Boolean
Allows to return debug information as part of the view response.
-
#end_key ⇒ #to_json
Specifies the key, at which the result generation has to be stopped.
-
#end_key_doc_id ⇒ String
Specifies the document id in case #end_key gives multiple results within the index.
-
#group ⇒ Boolean
Specifies whether to enable grouping of the results.
-
#group_level ⇒ Integer
Specifies the depth within the key to group the results.
-
#inclusive_end ⇒ Boolean
Specifies whether the #end_key/##end_key_doc_id values should be inclusive.
-
#key ⇒ #to_json
Specifies the set of the keys to fetch from the index.
-
#keys ⇒ Array<#to_json>
Specifies set of the keys to fetch from the index.
-
#limit ⇒ Integer
Specifies the maximum number of results to return.
- #namespace ⇒ :production, :development
-
#on_error ⇒ :stop, :continue
Specifies the behaviour of the view engine should an error occur during the gathering of view index results which would result in only partial results being available.
-
#order ⇒ :ascending, :descending
Specifies the order of the results that should be returned.
-
#reduce ⇒ Boolean
Specifies whether to enable the reduction function associated with this particular view index.
-
#scan_consistency ⇒ :not_bounded, ...
Specifies the level of consistency for the query.
-
#skip ⇒ Integer
Specifies the number of results to skip from the start of the result set.
-
#start_key ⇒ Object
Specifies the key, to which the engine has to skip before result generation.
-
#start_key_doc_id ⇒ String
Specifies the document id in case #start_key gives multiple results within the index.
-
#timeout ⇒ Integer
Timeout in milliseconds.
Instance Method Summary collapse
-
#initialize {|self| ... } ⇒ ViewOptions
constructor
A new instance of ViewOptions.
-
#raw(key, value) ⇒ Object
Allows providing custom JSON key/value pairs for advanced usage.
Constructor Details
#initialize {|self| ... } ⇒ ViewOptions
Returns a new instance of ViewOptions.
96 97 98 99 |
# File 'lib/couchbase/view_options.rb', line 96 def initialize @namespace = :production yield self if block_given? end |
Instance Attribute Details
#debug ⇒ Boolean
Returns allows to return debug information as part of the view response.
90 91 92 |
# File 'lib/couchbase/view_options.rb', line 90 def debug @debug end |
#end_key ⇒ #to_json
Specifies the key, at which the result generation has to be stopped
41 42 43 |
# File 'lib/couchbase/view_options.rb', line 41 def end_key @end_key end |
#end_key_doc_id ⇒ String
Specifies the document id in case #end_key gives multiple results within the index
49 50 51 |
# File 'lib/couchbase/view_options.rb', line 49 def end_key_doc_id @end_key_doc_id end |
#group ⇒ Boolean
Specifies whether to enable grouping of the results
58 59 60 |
# File 'lib/couchbase/view_options.rb', line 58 def group @group end |
#group_level ⇒ Integer
Specifies the depth within the key to group the results
63 64 65 |
# File 'lib/couchbase/view_options.rb', line 63 def group_level @group_level end |
#inclusive_end ⇒ Boolean
Specifies whether the #end_key/##end_key_doc_id values should be inclusive
53 54 55 |
# File 'lib/couchbase/view_options.rb', line 53 def inclusive_end @inclusive_end end |
#key ⇒ #to_json
Specifies the set of the keys to fetch from the index
67 68 69 |
# File 'lib/couchbase/view_options.rb', line 67 def key @key end |
#keys ⇒ Array<#to_json>
Specifies set of the keys to fetch from the index
72 73 74 |
# File 'lib/couchbase/view_options.rb', line 72 def keys @keys end |
#limit ⇒ Integer
Specifies the maximum number of results to return
34 35 36 |
# File 'lib/couchbase/view_options.rb', line 34 def limit @limit end |
#namespace ⇒ :production, :development
93 94 95 |
# File 'lib/couchbase/view_options.rb', line 93 def namespace @namespace end |
#on_error ⇒ :stop, :continue
Specifies the behaviour of the view engine should an error occur during the gathering of view index results which would result in only partial results being available
87 88 89 |
# File 'lib/couchbase/view_options.rb', line 87 def on_error @on_error end |
#order ⇒ :ascending, :descending
Specifies the order of the results that should be returned
77 78 79 |
# File 'lib/couchbase/view_options.rb', line 77 def order @order end |
#reduce ⇒ Boolean
Specifies whether to enable the reduction function associated with this particular view index
81 82 83 |
# File 'lib/couchbase/view_options.rb', line 81 def reduce @reduce end |
#scan_consistency ⇒ :not_bounded, ...
Specifies the level of consistency for the query
26 27 28 |
# File 'lib/couchbase/view_options.rb', line 26 def scan_consistency @scan_consistency end |
#skip ⇒ Integer
Specifies the number of results to skip from the start of the result set
30 31 32 |
# File 'lib/couchbase/view_options.rb', line 30 def skip @skip end |
#start_key ⇒ Object
Specifies the key, to which the engine has to skip before result generation
37 38 39 |
# File 'lib/couchbase/view_options.rb', line 37 def start_key @start_key end |
#start_key_doc_id ⇒ String
Specifies the document id in case #start_key gives multiple results within the index
45 46 47 |
# File 'lib/couchbase/view_options.rb', line 45 def start_key_doc_id @start_key_doc_id end |
#timeout ⇒ Integer
Returns Timeout in milliseconds.
22 23 24 |
# File 'lib/couchbase/view_options.rb', line 22 def timeout @timeout end |
Instance Method Details
#raw(key, value) ⇒ Object
Allows providing custom JSON key/value pairs for advanced usage
105 106 107 |
# File 'lib/couchbase/view_options.rb', line 105 def raw(key, value) @raw_parameters[key] = JSON.generate(value) end |