Class: Couchbase::Management::UpdateCollectionSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/management/collection_manager.rb

Constant Summary collapse

DEFAULT =
UpdateCollectionSettings.new.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(max_expiry: nil, history: nil) {|_self| ... } ⇒ UpdateCollectionSettings

Returns a new instance of UpdateCollectionSettings.

Yields:

  • (_self)

Yield Parameters:



420
421
422
423
424
425
# File 'lib/couchbase/management/collection_manager.rb', line 420

def initialize(max_expiry: nil, history: nil)
  @max_expiry = max_expiry
  @history = history

  yield self if block_given?
end

Instance Attribute Details

#historyBoolean?

not update it)

Returns:

  • (Boolean, nil)

    whether history retention override should be enabled in the collection (set to nil to



418
419
420
# File 'lib/couchbase/management/collection_manager.rb', line 418

def history
  @history
end

#max_expiryInteger?

(set to nil to not update it, and to -1 set it to no-expiry)

Returns:

  • (Integer, nil)

    time in seconds of the maximum expiration time for new documents in the collection



414
415
416
# File 'lib/couchbase/management/collection_manager.rb', line 414

def max_expiry
  @max_expiry
end

Instance Method Details

#to_backendObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



428
429
430
431
432
433
# File 'lib/couchbase/management/collection_manager.rb', line 428

def to_backend
  {
    max_expiry: @max_expiry,
    history: @history,
  }
end