Reference documentation and code samples for the Cloud Firestore API class Google::Cloud::Firestore::CommitResponse::WriteResult.
WriteResult
Represents the result of applying a write.
Inherits
Object
Example
require"google/cloud/firestore"firestore=Google::Cloud::Firestore.newcommit_response=firestore.batchdo|b|# Set the data for NYCb.set("cities/NYC",{name:"New York City"})# Update the population for SFb.update("cities/SF",{population:1000000})# Delete LAb.delete("cities/LA")endputscommit_response.commit_timecommit_response.write_results.eachdo|write_result|putswrite_result.update_timeend
Methods
#update_time
defupdate_time()->Time
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.
#update_time=
defupdate_time=(value)->Time
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Cloud Firestore API - Class Google::Cloud::Firestore::CommitResponse::WriteResult (v3.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [3.1.0 (latest)](/ruby/docs/reference/google-cloud-firestore/latest/Google-Cloud-Firestore-CommitResponse-WriteResult)\n- [3.0.0](/ruby/docs/reference/google-cloud-firestore/3.0.0/Google-Cloud-Firestore-CommitResponse-WriteResult)\n- [2.16.1](/ruby/docs/reference/google-cloud-firestore/2.16.1/Google-Cloud-Firestore-CommitResponse-WriteResult)\n- [2.15.1](/ruby/docs/reference/google-cloud-firestore/2.15.1/Google-Cloud-Firestore-CommitResponse-WriteResult)\n- [2.14.0](/ruby/docs/reference/google-cloud-firestore/2.14.0/Google-Cloud-Firestore-CommitResponse-WriteResult)\n- [2.13.1](/ruby/docs/reference/google-cloud-firestore/2.13.1/Google-Cloud-Firestore-CommitResponse-WriteResult)\n- [2.12.0](/ruby/docs/reference/google-cloud-firestore/2.12.0/Google-Cloud-Firestore-CommitResponse-WriteResult)\n- [2.11.0](/ruby/docs/reference/google-cloud-firestore/2.11.0/Google-Cloud-Firestore-CommitResponse-WriteResult)\n- [2.10.1](/ruby/docs/reference/google-cloud-firestore/2.10.1/Google-Cloud-Firestore-CommitResponse-WriteResult)\n- [2.9.1](/ruby/docs/reference/google-cloud-firestore/2.9.1/Google-Cloud-Firestore-CommitResponse-WriteResult)\n- [2.8.0](/ruby/docs/reference/google-cloud-firestore/2.8.0/Google-Cloud-Firestore-CommitResponse-WriteResult)\n- [2.7.2](/ruby/docs/reference/google-cloud-firestore/2.7.2/Google-Cloud-Firestore-CommitResponse-WriteResult)\n- [2.6.6](/ruby/docs/reference/google-cloud-firestore/2.6.6/Google-Cloud-Firestore-CommitResponse-WriteResult) \nReference documentation and code samples for the Cloud Firestore API class Google::Cloud::Firestore::CommitResponse::WriteResult.\n\nWriteResult\n-----------\n\nRepresents the result of applying a write. \n\nInherits\n--------\n\n- Object\n\nExample\n-------\n\n```ruby\nrequire \"google/cloud/firestore\"\n\nfirestore = Google::Cloud::Firestore.new\n\ncommit_response = firestore.batch do |b|\n # Set the data for NYC\n b.set(\"cities/NYC\", { name: \"New York City\" })\n\n # Update the population for SF\n b.update(\"cities/SF\", { population: 1000000 })\n\n # Delete LA\n b.delete(\"cities/LA\")\nend\n\nputs commit_response.commit_time\ncommit_response.write_results.each do |write_result|\n puts write_result.update_time\nend\n```\n\nMethods\n-------\n\n### #update_time\n\n def update_time() -\u003e Time\n\nThe last update time of the document after applying the write. Not\nset after a +delete+.\n\n\n\u003cbr /\u003e\n\nIf the write did not actually change the document, this will be\nthe previous update_time. \n**Returns**\n\n- (Time) --- The last update time.\n\n### #update_time=\n\n def update_time=(value) -\u003e Time\n\nThe last update time of the document after applying the write. Not\nset after a +delete+.\n\n\n\u003cbr /\u003e\n\nIf the write did not actually change the document, this will be\nthe previous update_time. \n**Parameter**\n\n- **value** (Time) --- The last update time. \n**Returns**\n\n- (Time) --- The last update time."]]