Method: Aerospike::CDT::MapOperation.set_policy

Defined in:
lib/aerospike/cdt/map_operation.rb

.set_policy(bin_name, policy, ctx: nil) ⇒ Object

Create set map policy operation. Server sets map policy attributes. Server returns null.

The required map policy attributes can be changed after the map is created.



139
140
141
142
143
144
145
146
# File 'lib/aerospike/cdt/map_operation.rb', line 139

def self.set_policy(bin_name, policy, ctx: nil)
  attr = policy.attributes
  # Remove persistIndex flag for nested maps.
  if !ctx.nil? && !ctx.empty? && (attr & 0x10) != 0
    attr &= ~0x10
  end
  MapOperation.new(Operation::CDT_MODIFY, SET_TYPE, bin_name, attr, ctx: ctx)
end