Class: Google::Cloud::Firestore::CommitResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/firestore/commit_response.rb

Overview

CommitResponse

The response for a commit.

Examples:

require "google/cloud/firestore"

firestore = Google::Cloud::Firestore.new

commit_response = firestore.batch do |b|
  # Set the data for NYC
  b.set("cities/NYC", { name: "New York City" })

  # Update the population for SF
  b.update("cities/SF", { population: 1000000 })

  # Delete LA
  b.delete("cities/LA")
end

puts commit_response.commit_time
commit_response.write_results.each do |write_result|
  puts write_result.update_time
end

Defined Under Namespace

Classes: WriteResult

Instance Attribute Summary collapse

Instance Attribute Details

#commit_timeTime

The time at which the commit occurred.

Returns:

  • (Time)

    The commit time.



60
61
62
# File 'lib/google/cloud/firestore/commit_response.rb', line 60

def commit_time
  @commit_time
end

#write_resultsArray<CommitResponse::WriteResult>

The result of applying the writes.

This i-th write result corresponds to the i-th write in the request.

Returns:



68
69
70
# File 'lib/google/cloud/firestore/commit_response.rb', line 68

def write_results
  @write_results
end