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

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

Overview

WriteResult

Represents the result of applying a write.

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

Instance Attribute Summary collapse

Instance Attribute Details

#update_timeTime

The last update time of the document after applying the write. Not set after a +delete+.

If the write did not actually change the document, this will be the previous update_time.

Returns:

  • (Time)

    The last update time.



140
141
142
# File 'lib/google/cloud/firestore/commit_response.rb', line 140

def update_time
  @update_time
end