I will post it as a memo.
--rails new
completed
--Project created with firebase
gem "google-cloud-firestore"
Download the json file from "Settings" → "Generate new private key" Put it in your Rails project
require "google/cloud/firestore"
firestore = Google::Cloud::Firestore.new(
#Here is my project ID
project_id: "my-project" ,
#Here "2.Specify the path of the json file of "Generate private key"
credentials: "/path/to/keyfile.json"
)
test_val = firestore.col("test_col").doc("test_doc").get().data[:test_field]
~ Scheduled to be added ~
~ Scheduled to be added ~
~ Scheduled to be added ~
Recommended Posts