Class: Couchbase::Options::Remove

Inherits:
Base
  • Object
show all
Defined in:
lib/couchbase/options.rb

Overview

Options for Collection#remove

Instance Attribute Summary collapse

Attributes inherited from Base

#client_context, #parent_span, #retry_strategy, #timeout

Instance Method Summary collapse

Constructor Details

#initialize(cas: nil, durability_level: :none, timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|| ... } ⇒ Remove

Creates an instance of options for Collection#remove

Parameters:

  • cas (Integer, nil) (defaults to: nil)

    CAS value for optimistic locking

  • durability_level (Symbol) (defaults to: :none)

    level of durability

    :none

    no enhanced durability required for the mutation

    :majority

    the mutation must be replicated to a majority of the Data Service nodes (that is, held in the memory allocated to the bucket)

    :majority_and_persist_to_active

    The mutation must be replicated to a majority of the Data Service nodes. Additionally, it must be persisted (that is, written and synchronised to disk) on the node hosting the active partition (vBucket) for the data.

    :persist_to_majority

    The mutation must be persisted to a majority of the Data Service nodes. Accordingly, it will be written to disk on those nodes.

  • timeout (Integer, #in_milliseconds, nil) (defaults to: nil)
  • retry_strategy (Proc, nil) (defaults to: nil)

    the custom retry strategy, if set

  • client_context (Hash, nil) (defaults to: nil)

    the client context data, if set

  • parent_span (Span, nil) (defaults to: nil)

    if set holds the parent span, that should be used for this request

Yield Parameters:



384
385
386
387
388
389
390
391
392
393
394
# File 'lib/couchbase/options.rb', line 384

def initialize(cas: nil,
               durability_level: :none,
               timeout: nil,
               retry_strategy: nil,
               client_context: nil,
               parent_span: nil)
  super(timeout: timeout, retry_strategy: retry_strategy, client_context: client_context, parent_span: parent_span)
  @cas = cas
  @durability_level = durability_level
  yield self if block_given?
end

Instance Attribute Details

#casInteger?

Returns:

  • (Integer, nil)


358
359
360
# File 'lib/couchbase/options.rb', line 358

def cas
  @cas
end

#durability_levelSymbol

Returns:

  • (Symbol)


359
360
361
# File 'lib/couchbase/options.rb', line 359

def durability_level
  @durability_level
end