Class: Couchbase::Collection::MutateInOptions

Inherits:
Couchbase::CommonOptions show all
Defined in:
lib/couchbase/collection_options.rb

Instance Attribute Summary collapse

Attributes inherited from Couchbase::CommonOptions

#client_context, #parent_span, #retry_strategy, #timeout

Instance Method Summary collapse

Constructor Details

#initialize {|| ... } ⇒ MutateInOptions

Returns a new instance of MutateInOptions.

Yield Parameters:

[View source]

359
360
361
362
363
364
# File 'lib/couchbase/collection_options.rb', line 359

def initialize
  @durability_level = :none
  @store_semantics = :replace
  @transcoder = JsonTranscoder.new
  yield self if block_given?
end

Instance Attribute Details

#access_deletedBoolean

Returns For internal use only: allows access to deleted documents that are in 'tombstone' form.

Returns:

  • (Boolean)

    For internal use only: allows access to deleted documents that are in 'tombstone' form


350
351
352
# File 'lib/couchbase/collection_options.rb', line 350

def access_deleted
  @access_deleted
end

#casInteger

Returns Specifies a CAS value that will be taken into account on the server side for optimistic concurrency.

Returns:

  • (Integer)

    Specifies a CAS value that will be taken into account on the server side for optimistic concurrency


347
348
349
# File 'lib/couchbase/collection_options.rb', line 347

def cas
  @cas
end

#create_as_deletedBoolean

Returns For internal use only: allows creating documents in 'tombstone' form.

Returns:

  • (Boolean)

    For internal use only: allows creating documents in 'tombstone' form


353
354
355
# File 'lib/couchbase/collection_options.rb', line 353

def create_as_deleted
  @create_as_deleted
end

#durability_level:none, ...

Returns level of durability.

Returns:

  • (:none, :majority, :majority_and_persist_to_active, :persist_to_majority)

    level of durability


356
357
358
# File 'lib/couchbase/collection_options.rb', line 356

def durability_level
  @durability_level
end

#expiryInteger

Returns expiration time to associate with the document.

Returns:

  • (Integer)

    expiration time to associate with the document


335
336
337
# File 'lib/couchbase/collection_options.rb', line 335

def expiry
  @expiry
end

#store_semantics:replace, ...

Describes how the outer document store semantics on subdoc should act

  • :replace: replace the document, fail if it does not exist. This is the default

  • :upsert: replace the document or create if it does not exist

  • :insert: create the document, fail if it exists

Returns:

  • (:replace, :upsert, :insert)

344
345
346
# File 'lib/couchbase/collection_options.rb', line 344

def store_semantics
  @store_semantics
end

#transcoderObject

Returns the value of attribute transcoder.


366
367
368
# File 'lib/couchbase/collection_options.rb', line 366

def transcoder
  @transcoder
end