Class: Couchbase::Bucket::ViewOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/view_options.rb,
/Users/sergey.auseyau/code/couchbase-ruby-client/lib/couchbase/view_options.rb
more...

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize {|self| ... } ⇒ ViewOptions

Returns a new instance of ViewOptions.

Yield Parameters:

[View source]

95
96
97
98
# File 'lib/couchbase/view_options.rb', line 95

def initialize
  @namespace = :production
  yield self if block_given?
end

Instance Attribute Details

#debugBoolean

Returns allows to return debug information as part of the view response.

Returns:

  • (Boolean)

    allows to return debug information as part of the view response


89
90
91
# File 'lib/couchbase/view_options.rb', line 89

def debug
  @debug
end

#end_key#to_json

Specifies the key, at which the result generation has to be stopped

Returns:

  • (#to_json)

40
41
42
# File 'lib/couchbase/view_options.rb', line 40

def end_key
  @end_key
end

#end_key_doc_idString

Specifies the document id in case #end_key gives multiple results within the index

Returns:

  • (String)

48
49
50
# File 'lib/couchbase/view_options.rb', line 48

def end_key_doc_id
  @end_key_doc_id
end

#groupBoolean

Specifies whether to enable grouping of the results

Returns:

  • (Boolean)

57
58
59
# File 'lib/couchbase/view_options.rb', line 57

def group
  @group
end

#group_levelInteger

Specifies the depth within the key to group the results

Returns:

  • (Integer)

62
63
64
# File 'lib/couchbase/view_options.rb', line 62

def group_level
  @group_level
end

#inclusive_endBoolean

Specifies whether the #end_key/##end_key_doc_id values should be inclusive

Returns:

  • (Boolean)

52
53
54
# File 'lib/couchbase/view_options.rb', line 52

def inclusive_end
  @inclusive_end
end

#key#to_json

Specifies the set of the keys to fetch from the index

Returns:

  • (#to_json)

66
67
68
# File 'lib/couchbase/view_options.rb', line 66

def key
  @key
end

#keysArray<#to_json>

Specifies set of the keys to fetch from the index

Returns:

  • (Array<#to_json>)

71
72
73
# File 'lib/couchbase/view_options.rb', line 71

def keys
  @keys
end

#limitInteger

Specifies the maximum number of results to return

Returns:

  • (Integer)

33
34
35
# File 'lib/couchbase/view_options.rb', line 33

def limit
  @limit
end

#namespace:production, :development

Returns:

  • (:production, :development)

92
93
94
# File 'lib/couchbase/view_options.rb', line 92

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

Returns:

  • (:stop, :continue)

86
87
88
# File 'lib/couchbase/view_options.rb', line 86

def on_error
  @on_error
end

#order:ascending, :descending

Specifies the order of the results that should be returned

Returns:

  • (:ascending, :descending)

76
77
78
# File 'lib/couchbase/view_options.rb', line 76

def order
  @order
end

#reduceBoolean

Specifies whether to enable the reduction function associated with this particular view index

Returns:

  • (Boolean)

80
81
82
# File 'lib/couchbase/view_options.rb', line 80

def reduce
  @reduce
end

#scan_consistency:not_bounded, ...

Specifies the level of consistency for the query

Returns:

  • (:not_bounded, :request_plus, :update_after)

25
26
27
# File 'lib/couchbase/view_options.rb', line 25

def scan_consistency
  @scan_consistency
end

#skipInteger

Specifies the number of results to skip from the start of the result set

Returns:

  • (Integer)

29
30
31
# File 'lib/couchbase/view_options.rb', line 29

def skip
  @skip
end

#start_keyObject

Specifies the key, to which the engine has to skip before result generation


36
37
38
# File 'lib/couchbase/view_options.rb', line 36

def start_key
  @start_key
end

#start_key_doc_idString

Specifies the document id in case #start_key gives multiple results within the index

Returns:

  • (String)

44
45
46
# File 'lib/couchbase/view_options.rb', line 44

def start_key_doc_id
  @start_key_doc_id
end

#timeoutInteger

Returns Timeout in milliseconds.

Returns:

  • (Integer)

    Timeout in milliseconds


21
22
23
# File 'lib/couchbase/view_options.rb', line 21

def timeout
  @timeout
end

Instance Method Details

#raw(key, value) ⇒ Object

Allows providing custom JSON key/value pairs for advanced usage

Parameters:

  • key (String)

    the parameter name (key of the JSON property)

  • value (Object)

    the parameter value (value of the JSON property)

[View source]

104
105
106
# File 'lib/couchbase/view_options.rb', line 104

def raw(key, value)
  @raw_parameters[key] = JSON.generate(value)
end