Reference documentation and code samples for the Cloud Firestore API class Google::Cloud::Firestore::CommitResponse.
CommitResponse
The response for a commit.
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
[[["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 (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)\n- [3.0.0](/ruby/docs/reference/google-cloud-firestore/3.0.0/Google-Cloud-Firestore-CommitResponse)\n- [2.16.1](/ruby/docs/reference/google-cloud-firestore/2.16.1/Google-Cloud-Firestore-CommitResponse)\n- [2.15.1](/ruby/docs/reference/google-cloud-firestore/2.15.1/Google-Cloud-Firestore-CommitResponse)\n- [2.14.0](/ruby/docs/reference/google-cloud-firestore/2.14.0/Google-Cloud-Firestore-CommitResponse)\n- [2.13.1](/ruby/docs/reference/google-cloud-firestore/2.13.1/Google-Cloud-Firestore-CommitResponse)\n- [2.12.0](/ruby/docs/reference/google-cloud-firestore/2.12.0/Google-Cloud-Firestore-CommitResponse)\n- [2.11.0](/ruby/docs/reference/google-cloud-firestore/2.11.0/Google-Cloud-Firestore-CommitResponse)\n- [2.10.1](/ruby/docs/reference/google-cloud-firestore/2.10.1/Google-Cloud-Firestore-CommitResponse)\n- [2.9.1](/ruby/docs/reference/google-cloud-firestore/2.9.1/Google-Cloud-Firestore-CommitResponse)\n- [2.8.0](/ruby/docs/reference/google-cloud-firestore/2.8.0/Google-Cloud-Firestore-CommitResponse)\n- [2.7.2](/ruby/docs/reference/google-cloud-firestore/2.7.2/Google-Cloud-Firestore-CommitResponse)\n- [2.6.6](/ruby/docs/reference/google-cloud-firestore/2.6.6/Google-Cloud-Firestore-CommitResponse) \nReference documentation and code samples for the Cloud Firestore API class Google::Cloud::Firestore::CommitResponse.\n\nCommitResponse\n--------------\n\nThe response for a commit. \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### #commit_time\n\n def commit_time() -\u003e Time\n\nThe time at which the commit occurred. \n**Returns**\n\n- (Time) --- The commit time.\n\n### #commit_time=\n\n def commit_time=(value) -\u003e Time\n\nThe time at which the commit occurred. \n**Parameter**\n\n- **value** (Time) --- The commit time. \n**Returns**\n\n- (Time) --- The commit time.\n\n### #write_results\n\n def write_results() -\u003e Array\u003cCommitResponse::WriteResult\u003e\n\nThe result of applying the writes.\n\n\n\u003cbr /\u003e\n\nThis i-th write result corresponds to the i-th write in the request. \n**Returns**\n\n- (Array\\\u003c[CommitResponse::WriteResult](./Google-Cloud-Firestore-CommitResponse-WriteResult)\\\u003e) --- The write results.\n\n### #write_results=\n\n def write_results=(value) -\u003e Array\u003cCommitResponse::WriteResult\u003e\n\nThe result of applying the writes.\n\n\n\u003cbr /\u003e\n\nThis i-th write result corresponds to the i-th write in the request. \n**Parameter**\n\n- **value** (Array\\\u003c[CommitResponse::WriteResult](./Google-Cloud-Firestore-CommitResponse-WriteResult)\\\u003e) --- The write results. \n**Returns**\n\n- (Array\\\u003c[CommitResponse::WriteResult](./Google-Cloud-Firestore-CommitResponse-WriteResult)\\\u003e) --- The write results."]]