Class: Couchbase::Collection::MutationResult

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of MutationResult.

Yield Parameters:



152
153
154
155
156
# File 'lib/couchbase/collection_options.rb', line 152

def initialize
  @error = nil
  @id = nil
  yield self if block_given?
end

Instance Attribute Details

#casInteger

Returns holds the CAS value of the document after the mutation.

Returns:

  • (Integer)

    holds the CAS value of the document after the mutation



133
134
135
# File 'lib/couchbase/collection_options.rb', line 133

def cas
  @cas
end

#errorError::CouchbaseError?

Returns error or nil (used in multi-operations like Couchbase::Collection#upsert_multi, Couchbase::Collection#remove_multi).

Returns:



140
141
142
# File 'lib/couchbase/collection_options.rb', line 140

def error
  @error
end

#idString?

Returns identifier of the document (used in multi-operations like Couchbase::Collection#upsert_multi, Couchbase::Collection#remove_multi).

Returns:



144
145
146
# File 'lib/couchbase/collection_options.rb', line 144

def id
  @id
end

#mutation_tokenMutationToken

Returns if returned, holds the mutation token of the document after the mutation.

Returns:

  • (MutationToken)

    if returned, holds the mutation token of the document after the mutation



136
137
138
# File 'lib/couchbase/collection_options.rb', line 136

def mutation_token
  @mutation_token
end

Instance Method Details

#success?Boolean

Returns true if error was not associated with the result (useful for multi-operations).

Returns:

  • (Boolean)

    true if error was not associated with the result (useful for multi-operations)



147
148
149
# File 'lib/couchbase/collection_options.rb', line 147

def success?
  !error
end